File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,10 +16,17 @@ else ()
1616 #
1717 # -fpermissive causes warnings like "-fpermissive is valid for C++/ObjC++ but not for C"
1818 #
19+ # Reference:
20+ # - gcc-4.8 https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/Warning-Options.html
21+ # - gcc-11.5 https://gcc.gnu.org/onlinedocs/gcc-11.5.0/gcc/Warning-Options.html
1922 add_compile_options (
20- $<$<COMPILE_LANGUAGE :C >:-Wincompatible -pointer -types >
2123 $<$<COMPILE_LANGUAGE :C >:-Wimplicit -function -declaration >
2224 )
25+ # https://gcc.gnu.org/gcc-5/changes.html introduces incompatible-pointer-types
26+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "5.1" )
27+ add_compile_options ($<$<COMPILE_LANGUAGE :C >:-Wincompatible -pointer -types >)
28+ endif ()
29+ # options benefit embedded system.
2330 add_compile_options (
2431 -Wdouble-promotion
2532 )
You can’t perform that action at this time.
0 commit comments