Skip to content

Commit bd8f4fa

Browse files
committed
Disable ICC compiler warnings
1 parent 7625a37 commit bd8f4fa

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,21 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
280280
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
281281
endif()
282282

283-
elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel")
284-
message(STATUS "Setting Intel C compiler options")
283+
elseif (CMAKE_C_COMPItheREQUAL "Intel")
284+
# T(ICC) his applies to the Intel Classic Compiler (ICC) only,
285+
# not Intel ICX compiler which appears to behave like clang.
286+
# NOTE: the ICC compiler is deprecated by Intel, Godbolt, and the Linux kernel,
287+
# and will likely not be supported by future flatcc releases.
288+
message(STATUS "Setting Intel C (ICC) compiler options")
285289
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall -Wextra")
290+
# warning #169: expected a declaration
291+
# Fallthrough attribute does not like semicolon.
292+
# this is fixed in Intel ICC 2021.5.0, but we only have 2021.4.0 in current CI build.
293+
# warning #279: controlling expression is constant
294+
# We have these everywhere in flatcc generated code.
295+
# warning #188: enumerated type mixed with another type
296+
# This is not very noisy, but still annoying, e.g. when zeroing an enum.
297+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd169 -wd279 -wd188")
286298
elseif (MSVC) # using STREQUAL here conflicts with string interpretation changes in CMake
287299
message(STATUS "Setting MSVC C compiler options")
288300
# -DFLATCC_PORTABLE also required, but set earlier

0 commit comments

Comments
 (0)