Remove empty initializers to ensure MSVC compatibility.
Add -Wgnu-empty-initializer to Clang builds to catch this issue in the future. Initialising arrays with empty braces is not part of the C standard and fails on MSVC. This commit should catch the issue earlier by detecting it in Clang. PiperOrigin-RevId: 517373961 Change-Id: I518006e84151e8d5b45a7fe00ba7675dfb031ca0
This commit is contained in:
committed by
Copybara-Service
parent
70959c1a2c
commit
ee566eb880
@@ -93,6 +93,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang
|
||||
-Wno-int-in-bool-context
|
||||
-Wno-sign-compare
|
||||
-Wno-unknown-pragmas
|
||||
-Wgnu-empty-initializer
|
||||
)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# Set -Wimplicit-fallthrough=5 to only allow fallthrough annotation via __attribute__.
|
||||
|
||||
Reference in New Issue
Block a user