From 5b4986f04bcf1fd927d0b085a2209451179c1e93 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 16 Jun 2017 22:40:03 -0700 Subject: [PATCH] Fix compiler warnings and turn on warnings as errors --- src/command_line.cc | 6 ++++++ src/project.cc | 3 ++- wscript | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/command_line.cc b/src/command_line.cc index 8cb3139b..9dabb7d4 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -403,6 +403,12 @@ optional BuildAutoImplementForFunction(QueryDatabase* db, WorkingFil break; } + case SymbolKind::Invalid: + case SymbolKind::File: + case SymbolKind::Type: + std::cerr << "Unexpected SymbolKind " + << static_cast(sym.idx.kind) << std::endl; + break; } } diff --git a/src/project.cc b/src/project.cc index 89addb48..8d8bb327 100644 --- a/src/project.cc +++ b/src/project.cc @@ -211,10 +211,10 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry( return result; } +/* TODO: Fix this function, it may be way faster than libclang's implementation. std::vector LoadFromCompileCommandsJson( std::unordered_set& quote_includes, std::unordered_set& angle_includes, const std::vector& extra_flags, const std::string& project_directory) { - // TODO: Fix this function, it may be way faster than libclang's implementation. optional compile_commands_content = ReadContent(project_directory + "/compile_commands.json"); if (!compile_commands_content) @@ -238,6 +238,7 @@ std::vector LoadFromCompileCommandsJson( } return result; } +*/ std::vector LoadFromDirectoryListing( std::unordered_set& quote_includes, std::unordered_set& angle_includes, diff --git a/wscript b/wscript index ac991da7..09642cca 100644 --- a/wscript +++ b/wscript @@ -130,7 +130,7 @@ def build(bld): bld.program( source=cc_files, - cxxflags=['-g', '-O3', '-std=c++11', '-Wall'], + cxxflags=['-g', '-O3', '-std=c++11', '-Wall', '-Werror'], includes=[ 'third_party/', 'third_party/doctest/',