disable pedantic for GCC >= 8
Disable -pedantic flag for GCC >= 8
@@ -209,8 +209,9 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
endif()
else()
message(STATUS "Setting GNU C compiler options with c11 and Posix")
+ if (GCC_VERSION VERSION_LESS 8.0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -pedantic -Wall -Wextra")
- if (NOT (GCC_VERSION VERSION_LESS 8.0))
+ elseif (NOT (GCC_VERSION VERSION_LESS 8.0))
# Disable some GCC checks:
# (warnings exist since 8.0, but are more aggressive in 9.0)
#
@@ -222,6 +223,8 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
# GCC 9 warns on mistakenly assumed NULL string when
# printing from a required FlatBuffer string field.
#
+ message(STATUS "Disabling -pedantic for GCC >= 8.0")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall -Wextra")
message(STATUS "Disabling GNU C compiler warnings: -Wstringop-truncation -Wno-format-overflow")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-stringop-truncation -Wno-format-overflow")
endif()
