mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Silence implicit fallthrough warning for gcc > 7
In my system I have gcc 7.1.1 and there I get a lot of warnings which fail the build due to implicit fallthroughs in switch statements. Some examples can be seen here: https://gist.github.com/LefterisJP/388c3ba5ad356f92a3b44e7efed89f9f This PR proposes a simple solution, which is to ignore the warning for both gcc and clang.
This commit is contained in:
parent
f5372cda5d
commit
735c977db1
@ -65,7 +65,7 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
|
||||
|
||||
# Build everything as shared libraries (.so files)
|
||||
add_definitions(-DSHAREDLIB)
|
||||
|
||||
|
||||
# If supported for the target machine, emit position-independent code, suitable for dynamic
|
||||
# linking and avoiding any limit on the size of the global offset table.
|
||||
add_compile_options(-fPIC)
|
||||
@ -94,6 +94,12 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
|
||||
add_compile_options(-fstack-protector)
|
||||
endif()
|
||||
|
||||
# Until https://github.com/ethereum/solidity/issues/2479 is handled
|
||||
# disable all implicit fallthrough warnings in the codebase for GCC > 7.0
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
|
||||
add_compile_options(-Wno-implicit-fallthrough)
|
||||
endif()
|
||||
|
||||
# Additional Clang-specific compiler settings.
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user