From 33f611cdf8d22aacdb252dee7f262a644af10882 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Tue, 3 Feb 2015 13:54:12 +1100 Subject: [PATCH] Fix -W flags for boost Fixes #801 --- android/scripts/common.sh | 2 -- gyp/common.gypi | 7 +------ include/mbgl/platform/default/jpeg_reader.hpp | 6 ++++++ include/mbgl/platform/default/png_reader.hpp | 6 ++++++ scripts/flags.sh | 3 --- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/android/scripts/common.sh b/android/scripts/common.sh index b594fd244..5c214fe25 100755 --- a/android/scripts/common.sh +++ b/android/scripts/common.sh @@ -7,8 +7,6 @@ NAME=$1 export JOBS=2 export CC=clang CXX=clang++ -export CXXFLAGS="-Wno-unknown-warning-option -Wno-unused-local-typedefs -Wno-unknown-pragmas ${CXXFLAGS}"; - export MASON_PLATFORM=android mkdir ./android/java/app/src/main/res/raw/ diff --git a/gyp/common.gypi b/gyp/common.gypi index d219ba2f9..92cfb2ab1 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -22,18 +22,13 @@ '-Wno-variadic-macros', '-frtti', '-fexceptions', - '-Wno-error=unused-parameter', ], 'GCC_WARN_PEDANTIC': 'YES', 'GCC_WARN_UNINITIALIZED_AUTOS': 'YES_AGGRESSIVE', }, }], ['OS=="linux"', { - 'cflags_cc': [ - '-Wno-unknown-pragmas', # We are using '#pragma mark', but it is only available on Darwin. - '-Wno-literal-suffix', # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61653 - '-Wno-unknown-warning-option', - '-Wno-error=unused-parameter', + 'cflags_cc': ['-Wno-unknown-pragmas', # We are using '#pragma mark', but it is only available on Darwin. ], }], ], diff --git a/include/mbgl/platform/default/jpeg_reader.hpp b/include/mbgl/platform/default/jpeg_reader.hpp index 7122f24cd..e041c0a5d 100644 --- a/include/mbgl/platform/default/jpeg_reader.hpp +++ b/include/mbgl/platform/default/jpeg_reader.hpp @@ -9,7 +9,13 @@ extern "C" #include } +#pragma GCC diagnostic push +#ifndef __clang__ +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wshadow" +#endif #include +#pragma GCC diagnostic pop namespace mbgl { namespace util { diff --git a/include/mbgl/platform/default/png_reader.hpp b/include/mbgl/platform/default/png_reader.hpp index 66debd4fb..649e7a75c 100644 --- a/include/mbgl/platform/default/png_reader.hpp +++ b/include/mbgl/platform/default/png_reader.hpp @@ -11,7 +11,13 @@ extern "C" #include #include +#pragma GCC diagnostic push +#ifndef __clang__ +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#pragma GCC diagnostic ignored "-Wshadow" +#endif #include +#pragma GCC diagnostic pop namespace mbgl { namespace util { diff --git a/scripts/flags.sh b/scripts/flags.sh index 8703677d0..10cc88e5c 100755 --- a/scripts/flags.sh +++ b/scripts/flags.sh @@ -30,6 +30,3 @@ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then # fi # fi fi - -# turn off a few warnings -export CXXFLAGS="-Wno-unknown-warning-option -Wno-unused-local-typedefs -Wno-unknown-pragmas ${CXXFLAGS}";