diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 20e9bfdcf..06460a68f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,7 +25,7 @@ endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") # Initialize CXXFLAGS. -set(CMAKE_CXX_FLAGS "-Wall -Wunused-parameter -std=c++11 ${LEAN_EXTRA_CXX_FLAGS}") +set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++11 ${LEAN_EXTRA_CXX_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "-g -DLEAN_DEBUG -DLEAN_TRACE") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") diff --git a/src/util/hash.cpp b/src/util/hash.cpp index e7f27882c..ffaea7460 100644 --- a/src/util/hash.cpp +++ b/src/util/hash.cpp @@ -33,7 +33,10 @@ unsigned hash_str(unsigned length, char const * str, unsigned init_value) { a += reinterpret_cast(str)[0]; b += reinterpret_cast(str)[1]; c += reinterpret_cast(str)[2]; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wextra" mix(a, b, c); +#pragma GCC diagnostic pop str += 12; len -= 12; } @@ -55,7 +58,10 @@ unsigned hash_str(unsigned length, char const * str, unsigned init_value) { case 1 : a+=str[0]; /* case 0: nothing left to add */ } - mix(a, b, c); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wextra" + mix(a, b, c); +#pragma GCC diagnostic pop /*-------------------------------------------- report the result */ return c; } diff --git a/src/util/sexpr/format.h b/src/util/sexpr/format.h index ea50ab980..df67bc296 100644 --- a/src/util/sexpr/format.h +++ b/src/util/sexpr/format.h @@ -88,7 +88,7 @@ private: lean_assert(sexpr_kind(s) == format_kind::TEXT); return cdr(s); } - static inline size_t const sexpr_text_length(sexpr const & s) { + static inline size_t sexpr_text_length(sexpr const & s) { lean_assert(sexpr_kind(s) == format_kind::TEXT); std::stringstream ss; sexpr const & content = cdr(s);