aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-08-06 17:55:01 +0800
committerGitHub <noreply@github.com>2018-08-06 17:55:01 +0800
commit74e6067347eb822c2e107c29d6ea58f22b328de7 (patch)
treef96cebd7c011543a64b568df42606b2fb8f26601
parent3576980710e019165db272afb4fc5e80f8bd5bff (diff)
parent6c3b48ddfcfb0849e1083cea8d4fae4446511be1 (diff)
downloaddexon-solidity-74e6067347eb822c2e107c29d6ea58f22b328de7.tar
dexon-solidity-74e6067347eb822c2e107c29d6ea58f22b328de7.tar.gz
dexon-solidity-74e6067347eb822c2e107c29d6ea58f22b328de7.tar.bz2
dexon-solidity-74e6067347eb822c2e107c29d6ea58f22b328de7.tar.lz
dexon-solidity-74e6067347eb822c2e107c29d6ea58f22b328de7.tar.xz
dexon-solidity-74e6067347eb822c2e107c29d6ea58f22b328de7.tar.zst
dexon-solidity-74e6067347eb822c2e107c29d6ea58f22b328de7.zip
Merge pull request #4602 from hackaugusto/warnings
Added guards for unknown pragmas
-rw-r--r--cmake/EthCompilerSettings.cmake13
-rw-r--r--libdevcore/Common.h2
-rw-r--r--libevmasm/KnownState.h14
-rw-r--r--liblll/CodeFragment.cpp10
4 files changed, 21 insertions, 18 deletions
diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake
index 515057fa..b0786ce2 100644
--- a/cmake/EthCompilerSettings.cmake
+++ b/cmake/EthCompilerSettings.cmake
@@ -36,13 +36,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
add_compile_options(-Wextra)
add_compile_options(-Werror)
- # Disable warnings about unknown pragmas (which is enabled by -Wall). I assume we have external
- # dependencies (probably Boost) which have some of these. Whatever the case, we shouldn't be
- # disabling these globally. Instead, we should pragma around just the problem #includes.
- #
- # TODO - Track down what breaks if we do NOT do this.
- add_compile_options(-Wno-unknown-pragmas)
-
# Configuration-specific compiler settings.
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
@@ -73,13 +66,13 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
# TODO - Is this even necessary? Why?
# See http://stackoverflow.com/questions/19774778/when-is-it-necessary-to-use-use-the-flag-stdlib-libstdc.
add_compile_options(-stdlib=libstdc++)
-
+
# Tell Boost that we're using Clang's libc++. Not sure exactly why we need to do.
add_definitions(-DBOOST_ASIO_HAS_CLANG_LIBCXX)
-
+
# Use fancy colors in the compiler diagnostics
add_compile_options(-fcolor-diagnostics)
-
+
# See "How to silence unused command line argument error with clang without disabling it?"
# When using -Werror with clang, it transforms "warning: argument unused during compilation" messages
# into errors, which makes sense.
diff --git a/libdevcore/Common.h b/libdevcore/Common.h
index 2543855d..0363d9a2 100644
--- a/libdevcore/Common.h
+++ b/libdevcore/Common.h
@@ -40,7 +40,6 @@
#include <libdevcore/vector_ref.h>
#if defined(__GNUC__)
-#pragma warning(push)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif // defined(__GNUC__)
@@ -57,7 +56,6 @@
#include <boost/multiprecision/cpp_int.hpp>
#if defined(__GNUC__)
-#pragma warning(pop)
#pragma GCC diagnostic pop
#endif // defined(__GNUC__)
diff --git a/libevmasm/KnownState.h b/libevmasm/KnownState.h
index 8568b163..cd50550e 100644
--- a/libevmasm/KnownState.h
+++ b/libevmasm/KnownState.h
@@ -29,12 +29,18 @@
#include <tuple>
#include <memory>
#include <ostream>
-#pragma warning(push)
-#pragma GCC diagnostic push
+
+#if defined(__clang__)
+#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wredeclared-class-member"
+#endif // defined(__clang__)
+
#include <boost/bimap.hpp>
-#pragma warning(pop)
-#pragma GCC diagnostic pop
+
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif // defined(__clang__)
+
#include <libdevcore/CommonIO.h>
#include <libdevcore/Exceptions.h>
#include <libevmasm/ExpressionClasses.h>
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index 3e82889a..0aef05a9 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -22,12 +22,18 @@
#include "CodeFragment.h"
#include <boost/algorithm/string.hpp>
-#pragma warning(push)
+
+#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif // defined(__GNUC__)
+
#include <boost/spirit/include/support_utree.hpp>
-#pragma warning(pop)
+
+#if defined(__GNUC__)
#pragma GCC diagnostic pop
+#endif // defined(__GNUC__)
+
#include <libdevcore/CommonIO.h>
#include <libevmasm/Instruction.h>
#include "CompilerState.h"