diff --git a/CMakeLists.txt b/CMakeLists.txt index 686027a..4571367 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,14 +99,19 @@ target_compile_options( SoufflePA PUBLIC -fopenmp -Werror - -Werror=all - -Werror=conversion - -Werror=extra - -Werror=pedantic - -Werror=return-type - -Werror=sign-conversion - -Werror=switch - -Wno-error=deprecated-declarations) + -Weverything + -Wno-c++98-c++11-compat-pedantic + -Wno-c++98-compat + -Wno-c++98-compat-pedantic + -Wno-documentation + -Wno-error=deprecated-declarations + -Wno-error=unused-macros + -Wno-exit-time-destructors + -Wno-global-constructors + -Wno-padded + -Wno-shadow + -Wno-undefined-func-template + -Wno-weak-vtables) target_include_directories(SoufflePA SYSTEM PUBLIC ${SOUFFLE_INCLUDE}) @@ -150,15 +155,21 @@ endif() # Warnings target_compile_options( PAPass - PUBLIC -Werror - -Werror=all - -Werror=conversion - -Werror=extra - -Werror=pedantic - -Werror=return-type - -Werror=sign-conversion - -Werror=switch - -fopenmp) + PUBLIC -fopenmp + -Werror + -Weverything + -Wno-c++98-c++11-compat-pedantic + -Wno-c++98-compat + -Wno-c++98-compat-pedantic + -Wno-documentation + -Wno-error=deprecated-declarations + -Wno-error=unused-macros + -Wno-exit-time-destructors + -Wno-global-constructors + -Wno-padded + -Wno-shadow + -Wno-undefined-func-template + -Wno-weak-vtables) target_link_libraries(PAPass PRIVATE PAPassInterface SoufflePA Boost::filesystem) diff --git a/FactGenerator/src/FactGenerator.cpp b/FactGenerator/src/FactGenerator.cpp index 8c5c63c..2da776e 100644 --- a/FactGenerator/src/FactGenerator.cpp +++ b/FactGenerator/src/FactGenerator.cpp @@ -25,8 +25,7 @@ auto FactGenerator::getInstance(FactWriter &writer) -> FactGenerator & { /* NOTE(ww): Stolen from Demangle.cpp (not present in LLVM 7). */ -static inline __attribute__((unused)) auto is_itanium_encoding( - const std::string &MangledName) -> bool { +static inline auto is_itanium_encoding(const std::string &MangledName) -> bool { size_t Pos = MangledName.find_first_not_of('_'); // A valid Itanium encoding requires 1-4 leading underscores, followed by // 'Z'. diff --git a/FactGenerator/src/InstructionVisitor.cpp b/FactGenerator/src/InstructionVisitor.cpp index ddd9075..681a800 100644 --- a/FactGenerator/src/InstructionVisitor.cpp +++ b/FactGenerator/src/InstructionVisitor.cpp @@ -843,7 +843,6 @@ static auto atomic_binop_string(const llvm::AtomicRMWInst::BinOp &op) #endif case llvm::AtomicRMWInst::BAD_BINOP: malformedModule("bad atomicrmw binop"); - break; } // -Wswitch prevents fallthrough, no need for default case assert(false); } diff --git a/src/PAInterface.h b/src/PAInterface.h index 5654d65..80e687f 100644 --- a/src/PAInterface.h +++ b/src/PAInterface.h @@ -38,7 +38,7 @@ auto extract_from_row( if constexpr (std::is_same::value) { try { return llvm_val_map.at(boost::flyweight(t0)); - } catch (const std::out_of_range &e) { + } catch (const std::out_of_range &) { std::cout << "Failed value* lookup: " << t0 << std::endl; exit(EXIT_FAILURE); } diff --git a/src/PointerAnalysis.cpp b/src/PointerAnalysis.cpp index a177589..3855d37 100644 --- a/src/PointerAnalysis.cpp +++ b/src/PointerAnalysis.cpp @@ -27,7 +27,7 @@ enum class Analysis { }; namespace cclyzer { -llvm::cl::opt datalog_analysis( +static llvm::cl::opt datalog_analysis( "datalog-analysis", llvm::cl::desc("Which pointer analysis to variant run"), llvm::cl::values( @@ -38,25 +38,25 @@ llvm::cl::opt datalog_analysis( "unification", "unification analysis only"))); -llvm::cl::opt datalog_debug_option( +static llvm::cl::opt datalog_debug_option( "debug-datalog", llvm::cl::desc("Keep intermediate files generated by datalog"), llvm::cl::init(false)); -llvm::cl::opt datalog_debug_dir_option( +static llvm::cl::opt datalog_debug_dir_option( "debug-datalog-dir", llvm::cl::desc("Where to keep intermediate files generated by datalog"), llvm::cl::init((fs::temp_directory_path() / fs::unique_path()).native())); -llvm::cl::opt datalog_check_assertions_option( +static llvm::cl::opt datalog_check_assertions_option( "check-datalog-assertions", llvm::cl::desc("Check assertions in the datalog code"), llvm::cl::init(false)); -llvm::cl::opt signatures( +static llvm::cl::opt signatures( "signatures", llvm::cl::desc("File with points-to signatures")); -llvm::cl::opt context_sensitivity( +static llvm::cl::opt context_sensitivity( "context-sensitivity", llvm::cl::desc("Set the context sensitivity of the pointer analysis"), llvm::cl::values( diff --git a/src/PointerAnalysis.h b/src/PointerAnalysis.h index 30a0dce..66f1ceb 100644 --- a/src/PointerAnalysis.h +++ b/src/PointerAnalysis.h @@ -85,7 +85,7 @@ class PointerAnalysisAAResult allocation_sizes_(allocation_sizes), allocation_sites_(allocation_sites), null_ptr_set_(null_ptr_set), - callgraph_(callgraph){}; + callgraph_(callgraph) {} auto alias( const llvm::MemoryLocation&,