Skip to content

Commit

Permalink
Break compilation on warning
Browse files Browse the repository at this point in the history
Turn (almost) all warnings into errors to ensure no new warnings enter
the code base.

-Wcast-align is not an error because fixing the findings requires a bit
more work than what I am willing to do right now and the tinydtls yields
some findings.
  • Loading branch information
rettichschnidi committed Mar 31, 2023
1 parent f2ff386 commit 6b3b347
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions wakaama.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function(target_sources_shared target)
target_include_directories(${target} PUBLIC ${WAKAAMA_EXAMPLE_SHARED_DIRECTORY})
endfunction()

# Warn about problematic code (not yet enforced)
# Enforce a certain level of hygiene
add_compile_options(
-Waggregate-return
-Wall
Expand All @@ -120,24 +120,17 @@ add_compile_options(
-Wshadow
-Wswitch-default
-Wwrite-strings
-Werror=absolute-value
-pedantic

# Reduce noise: Unused parameters are common in this ifdef-littered code-base, but of no danger
-Wno-unused-parameter
# Reduce noise: Too many false positives
-Wno-uninitialized
)

# Turn certain warnings into errors
add_compile_options(
-Werror=discarded-qualifiers
-Werror=incompatible-pointer-types
-Werror=float-equal
-Werror=shadow
-Werror=sign-compare
-Werror=strict-prototypes
-Werror=switch-default
# Turn (most) warnings into errors
-Werror
# Disabled because of existing, non-trivially fixable code
-Wno-error=cast-align
)

# The maximum buffer size that is provided for resource responses and must be respected due to the limited IP buffer.
Expand Down

0 comments on commit 6b3b347

Please sign in to comment.