diff options
author | Patrick Steinhardt <ps@pks.im> | 2018-06-22 13:41:17 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-06-22 13:48:55 +0200 |
commit | cacbf99889fd9c971aacde280dcad6192cd0017e (patch) | |
tree | ed41f40fa2129665531309efc87493b0d18abaa3 /deps | |
parent | e212011b9872c52f6205d3a30b10f753c3108918 (diff) | |
download | libgit2-cacbf99889fd9c971aacde280dcad6192cd0017e.tar.gz |
deps: fix implicit fallthrough warning in http-parser
GCC 7 has introduced new warnings for implicit fallthrough in switch
statements. Whenever there is no branch in a case block, GCC will watch
out for some heuristics which indicate that the implicit fallthrough is
intended, like a "fallthrough" comment. The third-party http-parser code
manages to trick this heuristic in one case, even though there is a
"FALLTHROUGH" comment. Fortunately, GCC has also added a strictness
level to the -Wimplicit-fallthrough diagnostic, such that we can loosen
this heuristic and make it more lax.
Set -Wimplicit-fallthrough=1 in http-parser's CMake build instructions,
which is the strictest level that gets rid of the warning. This level
will treat any kind of comment as a "fallthrough" comment, which
silences the warning.
Diffstat (limited to 'deps')
-rw-r--r-- | deps/http-parser/CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/deps/http-parser/CMakeLists.txt b/deps/http-parser/CMakeLists.txt index 77d9de7a3..4a8bafd2f 100644 --- a/deps/http-parser/CMakeLists.txt +++ b/deps/http-parser/CMakeLists.txt @@ -1,3 +1,5 @@ FILE(GLOB SRC_HTTP "*.c" "*.h") ADD_LIBRARY(http-parser OBJECT ${SRC_HTTP}) + +ENABLE_WARNINGS(implicit-fallthrough=1) |