diff --git a/CMakeLists.txt b/CMakeLists.txt index a875e96..c87dee5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ else (MSVC) set(CPPLINT_ARG_OUTPUT "--output=eclipse") set(CPPCHECK_ARG_TEMPLATE "--template=gcc") # Useful compile flags and extra warnings - add_compile_options(-fstack-protector -Wall -Winit-self -Wswitch-enum -Wshadow -Winline) + add_compile_options(-fstack-protector -Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline) if (CMAKE_COMPILER_IS_GNUCXX) # GCC flags if (SQLITECPP_USE_GCOV AND CMAKE_COMPILER_IS_GNUCXX) diff --git a/include/SQLiteCpp/Database.h b/include/SQLiteCpp/Database.h index 0129809..d3184c0 100644 --- a/include/SQLiteCpp/Database.h +++ b/include/SQLiteCpp/Database.h @@ -412,7 +412,7 @@ public: * * @throw SQLite::Exception in case of error */ - static const bool isUnencrypted(const std::string& aFilename); + static bool isUnencrypted(const std::string& aFilename); private: /// @{ Database must be non-copyable diff --git a/src/Database.cpp b/src/Database.cpp index cfa5447..164f3e3 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -259,13 +259,14 @@ void Database::rekey(const std::string& aNewKey) const check(ret); } #else // SQLITE_HAS_CODEC + static_cast(aNewKey); // silence unused parameter warning const SQLite::Exception exception("No encryption support, recompile with SQLITE_HAS_CODEC to enable."); throw exception; #endif // SQLITE_HAS_CODEC } // Test if a file contains an unencrypted database. -const bool Database::isUnencrypted(const std::string& aFilename) +bool Database::isUnencrypted(const std::string& aFilename) { if (aFilename.length() > 0) { std::ifstream fileBuffer(aFilename.c_str(), std::ios::in | std::ios::binary);