Skip to content

Commit bb5dbd2

Browse files
committed
only enable warnings with approriate gcc version for rp2040
1 parent 0bfb9d6 commit bb5dbd2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

examples/example.cmake

+10-9
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,29 @@ target_compile_options(${PROJECT} PUBLIC
44
-Werror
55
-Wfatal-errors
66
-Wdouble-promotion
7-
#-Wstrict-prototypes
8-
-Wstrict-overflow
9-
#-Werror-implicit-function-declaration
107
-Wfloat-equal
11-
#-Wundef
128
-Wshadow
139
-Wwrite-strings
1410
-Wsign-compare
1511
-Wmissing-format-attribute
1612
-Wunreachable-code
1713
-Wcast-align
18-
-Wcast-function-type
1914
-Wcast-qual
2015
-Wnull-dereference
2116
-Wuninitialized
2217
-Wunused
2318
-Wredundant-decls
19+
#-Wstrict-prototypes
20+
#-Werror-implicit-function-declaration
21+
#-Wundef
2422
)
2523

26-
# GCC version 9 or prior has a bug with incorrect Wconversion warnings
24+
# GCC 10
2725
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
28-
target_compile_options(${PROJECT} PUBLIC
29-
-Wconversion
30-
)
26+
target_compile_options(${PROJECT} PUBLIC -Wconversion)
27+
endif()
28+
29+
# GCC 8
30+
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
31+
target_compile_options(${PROJECT} PUBLIC -Wcast-function-type -Wstrict-overflow)
3132
endif()

0 commit comments

Comments
 (0)