Skip to content

Commit 55e67f3

Browse files
enable -Wall -Wextra for GCC, fix warnings, closes #173
1 parent 3a3ecf4 commit 55e67f3

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
3333
-Wno-unused-member-function
3434
-Werror
3535
)
36+
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
37+
set(cista-compile-flags -Wall -Wextra)
3638
endif()
3739

3840
option(CISTA_ZERO_OUT "zero out fresh memory for valgrind" OFF)

include/cista/containers/mutable_fws_multimap.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,17 @@ struct dynamic_fws_multimap_base {
5151
size_type capacity() const noexcept { return get_index().capacity_; }
5252
bool empty() const noexcept { return size() == 0; }
5353

54+
#ifdef __clang__
5455
#pragma clang diagnostic push
5556
#pragma clang diagnostic ignored "-Wclass-conversion"
57+
#endif
5658
template <bool IsConst = Const, typename = std::enable_if_t<!IsConst>>
5759
operator bucket<true>() {
5860
return bucket{multimap_, index_};
5961
}
62+
#ifdef __clang__
6063
#pragma clang diagnostic pop
64+
#endif
6165

6266
iterator begin() { return mutable_mm().data_.begin() + get_index().begin_; }
6367

include/cista/containers/string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ struct basic_string : public generic_string<Ptr> {
339339
basic_string(char const* s, typename base::msize_t const len)
340340
: base{s, len, base::owning} {}
341341

342-
basic_string(basic_string const& o) { base::set_owning(o.data(), o.size()); }
342+
basic_string(basic_string const& o) : base{o.view(), base::owning} {}
343343
basic_string(basic_string&& o) { base::move_from(std::move(o)); }
344344

345345
basic_string& operator=(basic_string const& o) {

0 commit comments

Comments
 (0)