diff options
author | Pierre Langlois <pierre.langlois@arm.com> | 2017-05-05 13:14:35 +0100 |
---|---|---|
committer | Pierre Langlois <pierre.langlois@arm.com> | 2017-05-08 13:24:01 +0100 |
commit | f7bf65575dd402847c15b566c2873d59cbe6ee30 (patch) | |
tree | e7fab589606f6e6473d89da47d98ef1328be202b | |
parent | 1cb7144de5478fd860f6d64fad4207730d2e139b (diff) |
Silence warnings about throwing from destructors when compiling with negative testing
GCC 6 now warns if one throws from a destructor. However, we need to do it when
negative testing is enabled so let's silence warnings for these cases.
Change-Id: Ib6e621ed52edd3478bb0113147f46dc92c9e3805
-rw-r--r-- | SConstruct | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -372,6 +372,17 @@ def ConfigureEnvironmentForCompiler(env): if compiler == 'gcc-4.8': env.Append(CPPFLAGS = ['-Wno-maybe-uninitialized']) + # GCC 6 and higher is able to detect throwing from inside a destructor and + # reports a warning. However, if negative testing is enabled then assertions + # will throw exceptions. + if env['negative_testing'] == 'on' and env['mode'] == 'debug' \ + and compiler >= 'gcc-6': + env.Append(CPPFLAGS = ['-Wno-terminate']) + # The C++11 compatibility warning will also be triggered for this case, as + # the behavior of throwing from desctructors has changed. + if 'std' in env and env['std'] == 'c++98': + env.Append(CPPFLAGS = ['-Wno-c++11-compat']) + # When compiling with c++98 (the default), allow long long constants. if 'std' not in env or env['std'] == 'c++98': env.Append(CPPFLAGS = ['-Wno-long-long']) |