diff --git a/configure.in b/configure.in index bdaf6a58020..ac2697a1bb2 100644 --- a/configure.in +++ b/configure.in @@ -1255,11 +1255,6 @@ if test "$GNU_CC"; then fi fi WARNINGS_AS_ERRORS='-Werror' - # Don't treat -Wuninitialized as error b/c it has lots of false positives. - WARNINGS_AS_ERRORS="$WARNINGS_AS_ERRORS -Wno-error=uninitialized" - # Don't treat -Wdeprecated-declarations as error b/c we don't want our - # builds held hostage when a platform-specific API is suddenly deprecated. - WARNINGS_AS_ERRORS="$WARNINGS_AS_ERRORS -Wno-error=deprecated-declarations" DSO_CFLAGS='' DSO_PIC_CFLAGS='-fPIC' ASFLAGS="$ASFLAGS -fPIC" @@ -6998,6 +6993,15 @@ MOZ_ARG_ENABLE_BOOL(warnings-as-errors, MOZ_ENABLE_WARNINGS_AS_ERRORS=) if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then WARNINGS_AS_ERRORS='' +elif test "$GNU_CC"; then + # Prevent the following GCC warnings from being treated as errors: + # -Wuninitialized - too many false positives + # -Wdeprecated-declarations - we don't want our builds held hostage when a + # platform-specific API becomes deprecated. + MOZ_C_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_c_has_noerror_uninitialized) + MOZ_CXX_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_cxx_has_noerror_uninitialized) + MOZ_C_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_c_has_noerror_deprecated_declarations) + MOZ_CXX_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_cxx_has_noerror_deprecated_declarations) fi dnl ======================================================== diff --git a/js/src/configure.in b/js/src/configure.in index e7790d09dca..e3bae3cf45e 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -1066,11 +1066,6 @@ if test "$GNU_CC"; then fi fi WARNINGS_AS_ERRORS='-Werror' - # Don't treat -Wuninitialized as error b/c it has lots of false positives. - WARNINGS_AS_ERRORS="$WARNINGS_AS_ERRORS -Wno-error=uninitialized" - # Don't treat -Wdeprecated-declarations as error b/c we don't want our - # builds held hostage when a platform-specific API is suddenly deprecated. - WARNINGS_AS_ERRORS="$WARNINGS_AS_ERRORS -Wno-error=deprecated-declarations" DSO_CFLAGS='' DSO_PIC_CFLAGS='-fPIC' ASFLAGS="$ASFLAGS -fPIC" @@ -3265,6 +3260,15 @@ MOZ_ARG_DISABLE_BOOL(warnings-as-errors, MOZ_ENABLE_WARNINGS_AS_ERRORS=) if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then WARNINGS_AS_ERRORS='' +elif test "$GNU_CC"; then + # Prevent the following GCC warnings from being treated as errors: + # -Wuninitialized - too many false positives + # -Wdeprecated-declarations - we don't want our builds held hostage when a + # platform-specific API becomes deprecated. + MOZ_C_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_c_has_noerror_uninitialized) + MOZ_CXX_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_cxx_has_noerror_uninitialized) + MOZ_C_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_c_has_noerror_deprecated_declarations) + MOZ_CXX_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_cxx_has_noerror_deprecated_declarations) fi dnl ========================================================