Skip to content

Commit

Permalink
enable -Wall -Wextra for GCC, fix warnings, closes #173
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Jan 30, 2023
1 parent 3a3ecf4 commit 55e67f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
-Wno-unused-member-function
-Werror
)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(cista-compile-flags -Wall -Wextra)
endif()

option(CISTA_ZERO_OUT "zero out fresh memory for valgrind" OFF)
Expand Down
4 changes: 4 additions & 0 deletions include/cista/containers/mutable_fws_multimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ struct dynamic_fws_multimap_base {
size_type capacity() const noexcept { return get_index().capacity_; }
bool empty() const noexcept { return size() == 0; }

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wclass-conversion"
#endif
template <bool IsConst = Const, typename = std::enable_if_t<!IsConst>>
operator bucket<true>() {
return bucket{multimap_, index_};
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif

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

Expand Down
2 changes: 1 addition & 1 deletion include/cista/containers/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ struct basic_string : public generic_string<Ptr> {
basic_string(char const* s, typename base::msize_t const len)
: base{s, len, base::owning} {}

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

basic_string& operator=(basic_string const& o) {
Expand Down

0 comments on commit 55e67f3

Please sign in to comment.