# HG changeset patch # User Tom Henderson # Date 1443496991 25200 # Node ID d12d2c296132cbde7d51d703d01211971ba79dbb # Parent d6e7902b45b1233508865300c54b189b5df416a6 bug 2181: Xcode 7.0 (clang-602.0.53) errors diff -r d6e7902b45b1 -r d12d2c296132 wscript --- a/wscript Sun Sep 27 10:49:52 2015 +0200 +++ b/wscript Mon Sep 28 20:23:11 2015 -0700 @@ -30,10 +30,20 @@ examples_enabled = False tests_enabled = False +# Compiler warning suppressions + # Bug 1868: be conservative about -Wstrict-overflow for optimized builds # on older compilers; it can generate spurious warnings. cc_version_warn_strict_overflow = ('4', '8', '2') +# Bug 2181: clang warnings about unused local typedefs and potentially +# evaluated expressions affecting darwin clang/LLVM version 7.0.0 (Xcode 7) +# or clang/LLVM version 3.6 or greater. We must make this platform-specific. +darwin_clang_version_warn_unused_local_typedefs = ('7', '0', '0') +darwin_clang_version_warn_potentially_evaluated = ('7', '0', '0') +clang_version_warn_unused_local_typedefs = ('3', '6', '0') +clang_version_warn_potentially_evaluated = ('3', '6', '0') + # Get the information out of the NS-3 configuration file. config_file_exists = False (config_file_exists, modules_enabled, examples_enabled, tests_enabled) = read_config_file() @@ -374,6 +384,18 @@ if conf.check_compilation_flag('-Wl,--soname=foo'): env['WL_SONAME_SUPPORTED'] = True + # bug 2181 on clang warning suppressions + if conf.env['CXX_NAME'] in ['clang']: + if Options.platform == 'darwin': + if conf.env['CC_VERSION'] >= darwin_clang_version_warn_unused_local_typedefs: + env.append_value('CXXFLAGS', '-Wno-unused-local-typedefs') + if conf.env['CC_VERSION'] >= darwin_clang_version_warn_potentially_evaluated: + env.append_value('CXXFLAGS', '-Wno-potentially-evaluated-expression') + else: + if conf.env['CC_VERSION'] >= clang_version_warn_unused_local_typedefs: + env.append_value('CXXFLAGS', '-Wno-unused-local-typedefs') + if conf.env['CC_VERSION'] >= clang_version_warn_potentially_evaluated: + env.append_value('CXXFLAGS', '-Wno-potentially-evaluated-expression') env['ENABLE_STATIC_NS3'] = False if Options.options.enable_static: if Options.platform == 'darwin':