Error on all C/C++ compiler warnings in src/
and tests/
#292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enables the GCC/Clang
-Werror
flag on everything in the src/ and tests/ folder.It's only enabled if
-DCMAKE_BUILD_TYPE=Debug
. This is so that any 3rd parties using edgesec (for example https://github.com/nqminds/manysecured-openwrt-packages or even the.deb
build) should still be able to compile edgesec, even if they have a newer version of GCC/Clang that adds new warnings.These warnings are usually pretty useful, so we probably want to fix them all. If we ever want to disable this, we can do:
Or better yet, we can use
target_compile_options
to disable them just in one file:There was only one minor warning left to fix in our code, see test(os): fix const correctness argv warning.
(OpenSSL,
lib/libnetlink
,sqlite3
andlibpcap
print a lot of warnings, but since they're not insrc/
andtests/
, they won't be converted to errors.