diff --git a/configure.in b/configure.in index 6922ed96ced6..151ce22450c9 100644 --- a/configure.in +++ b/configure.in @@ -1500,9 +1500,11 @@ if test "$GNU_CC"; then _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=return-type" _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=sequence-point" _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=trigraphs" + _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=uninitialized" _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=unknown-pragmas" MOZ_C_SUPPORTS_WARNING(-Werror=, non-literal-null-conversion, ac_c_has_werror_non_literal_null_conversion) + MOZ_C_SUPPORTS_WARNING(-Werror=, sometimes-uninitialized, ac_c_has_sometimes_uninitialized) fi # Turn off the following warnings that -Wall turns on: @@ -1593,9 +1595,11 @@ if test "$GNU_CXX"; then _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=switch" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=trigraphs" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=type-limits" + _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=uninitialized" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=unused-label" MOZ_CXX_SUPPORTS_WARNING(-Werror=, non-literal-null-conversion, ac_cxx_has_werror_non_literal_null_conversion) + MOZ_CXX_SUPPORTS_WARNING(-Werror=, sometimes-uninitialized, ac_cxx_has_sometimes_uninitialized) fi # Turn off the following warnings that -Wall turns on: @@ -6906,14 +6910,11 @@ 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 # -Wmaybe-uninitialized - too many false positives # -Wdeprecated-declarations - we don't want our builds held hostage when a # platform-specific API becomes deprecated. # -Wfree-nonheap-object - false positives during PGO # -Warray-bounds - false positives depending on optimization - 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=maybe-uninitialized, ac_c_has_noerror_maybe_uninitialized) MOZ_CXX_SUPPORTS_WARNING(-W, no-error=maybe-uninitialized, ac_cxx_has_noerror_maybe_uninitialized) MOZ_C_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_c_has_noerror_deprecated_declarations) diff --git a/js/src/configure.in b/js/src/configure.in index 7c3825ef9fa0..878ee3b6788d 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -1232,10 +1232,12 @@ if test "$GNU_CC"; then _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=sequence-point" _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=switch" _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=trigraphs" + _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=uninitialized" _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=unknown-pragmas" _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Werror=write-strings" MOZ_C_SUPPORTS_WARNING(-Werror=, non-literal-null-conversion, ac_c_has_werror_non_literal_null_conversion) + MOZ_C_SUPPORTS_WARNING(-Werror=, sometimes-uninitialized, ac_c_has_sometimes_uninitialized) fi # Turn off the following warnings that -Wall turns on: @@ -1335,6 +1337,7 @@ if test "$GNU_CXX"; then _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=sequence-point" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=switch" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=trigraphs" + _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=uninitialized" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=unknown-pragmas" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=unused-label" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=unused-value" @@ -1342,6 +1345,7 @@ if test "$GNU_CXX"; then MOZ_CXX_SUPPORTS_WARNING(-Werror=, conversion-null, ac_cxx_has_werror_conversion_null) MOZ_CXX_SUPPORTS_WARNING(-Werror=, non-literal-null-conversion, ac_cxx_has_werror_non_literal_null_conversion) + MOZ_CXX_SUPPORTS_WARNING(-Werror=, sometimes-uninitialized, ac_cxx_has_sometimes_uninitialized) fi # Turn off the following warnings that -Wall turns on: @@ -2917,14 +2921,11 @@ 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 # -Wmaybe-uninitialized - too many false positives # -Wdeprecated-declarations - we don't want our builds held hostage when a # platform-specific API becomes deprecated. # -Wfree-nonheap-object - false positives during PGO # -Warray-bounds - false positives depending on optimization - 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=maybe-uninitialized, ac_c_has_noerror_maybe_uninitialized) MOZ_CXX_SUPPORTS_WARNING(-W, no-error=maybe-uninitialized, ac_cxx_has_noerror_maybe_uninitialized) MOZ_C_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_c_has_noerror_deprecated_declarations)