diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2017-06-29 22:46:55 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-06-29 22:46:55 +0800 |
commit | 735c977db1824436d09d8e7a5c120fcab21003c3 (patch) | |
tree | c54b86f9ffe2544d18118913bca6388f88510992 /cmake | |
parent | f5372cda5dee20aab456a318a1660d1fea0eeed5 (diff) | |
download | dexon-solidity-735c977db1824436d09d8e7a5c120fcab21003c3.tar dexon-solidity-735c977db1824436d09d8e7a5c120fcab21003c3.tar.gz dexon-solidity-735c977db1824436d09d8e7a5c120fcab21003c3.tar.bz2 dexon-solidity-735c977db1824436d09d8e7a5c120fcab21003c3.tar.lz dexon-solidity-735c977db1824436d09d8e7a5c120fcab21003c3.tar.xz dexon-solidity-735c977db1824436d09d8e7a5c120fcab21003c3.tar.zst dexon-solidity-735c977db1824436d09d8e7a5c120fcab21003c3.zip |
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.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/EthCompilerSettings.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 97db9168..ea3b185a 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -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") |