# HG changeset patch # User Ted Campbell # Date 1536358064 14400 # Fri Sep 07 18:07:44 2018 -0400 # Node ID caa56a2cab83b62b722dbbd1191f759d87d2850a # Parent 37187fa0c81aa7d8ee6e6d8fc2394e0aba44b444 Bug 1489698 - Cleanup CXXFLAGS in js/src/moz.build. r=froydnj - Remove CFLAGS definitions since we don't build any non-C++. They were misleading cruft, particularly references to fp:precise. - Split fno-strict-aliasing from warnings list to make it clearer. MozReview-Commit-ID: JND7TULAzLc diff --git a/js/src/moz.build b/js/src/moz.build --- a/js/src/moz.build +++ b/js/src/moz.build @@ -691,35 +691,31 @@ DEFINES['EXPORT_JS_API'] = True if CONFIG['JS_HAS_CTYPES']: DEFINES['JS_HAS_CTYPES'] = True if CONFIG['MOZ_LINKER']: DEFINES['MOZ_LINKER'] = True if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'): - # Prevent floating point errors caused by VC++ optimizations - # XXX We should add this to CXXFLAGS, too? - CFLAGS += ['-fp:precise'] # C4805 warns mixing bool with other integral types in computation. # But given the conversion from bool is specified, and this is a # pattern widely used in code in js/src, suppress this warning here. CXXFLAGS += ['-wd4805'] # C4661 ("no suitable definition provided for explicit template # instantiation request") is emitted for all Parser methods that # have a Parser definition but no # Parser definition, see bug 1167030. CXXFLAGS += ['-wd4661'] # FIXME: unary minus operator applied to unsigned type (bug 1229189) CXXFLAGS += ['-wd4146'] # FIXME: 'operation' : conversion from 'type1' to 'type2' of # greater size (bug 1259304) CXXFLAGS += ['-wd4312'] -CFLAGS += CONFIG['MOZ_ICU_CFLAGS'] CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS'] # Prepare self-hosted JS code for embedding GENERATED_FILES += [('selfhosted.out.h', 'selfhosted.js')] selfhosted = GENERATED_FILES[('selfhosted.out.h', 'selfhosted.js')] selfhosted.script = 'builtin/embedjs.py:generate_selfhosted' selfhosted.inputs = [ 'js.msg', @@ -764,19 +760,20 @@ selfhosted.inputs = [ if CONFIG['JS_HAS_CTYPES']: if CONFIG['MOZ_SYSTEM_FFI']: CXXFLAGS += CONFIG['MOZ_FFI_CFLAGS'] else: # Windows needs this to be linked with a static library. DEFINES['FFI_BUILDING'] = True if CONFIG['CC_TYPE'] in ('clang', 'gcc'): + CXXFLAGS += ['-Wno-shadow', '-Werror=format'] # Also disable strict-aliasing for GCC compiler, that is enabled by default # starting with version 7.1, see Bug 1363009 - CXXFLAGS += ['-Wno-shadow', '-Werror=format', '-fno-strict-aliasing'] + CXXFLAGS += ['-fno-strict-aliasing'] # Suppress warnings in third-party code. if CONFIG['CC_TYPE'] == 'clang': SOURCES['jsdtoa.cpp'].flags += ['-Wno-implicit-fallthrough'] # Generate GC statistics phase data. GENERATED_FILES += ['gc/StatsPhasesGenerated.h'] StatsPhasesGeneratedHeader = GENERATED_FILES['gc/StatsPhasesGenerated.h']