]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
/
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Oct 2013 17:30:05 +0000 (17:30 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Oct 2013 17:30:05 +0000 (17:30 +0000)
* Makefile.tpl (STAGE1_CONFIGURE_FLAGS): Pass
--disable-build-format-warnings.
gcc/
* configure.ac (loose_warn): Add -Wno-format if
--disable-build-format-warnings.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204217 138bc75d-0d04-0410-961f-82ee72b054a4

ChangeLog
Makefile.in
Makefile.tpl
gcc/ChangeLog
gcc/configure
gcc/configure.ac

index f5563b2d3aa7e7578838100d28f9de1567f73bab..e9259598d208d68ff26ce2734ff1477b2459a686 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-30  Jason Merrill  <jason@redhat.com>
+
+       * Makefile.tpl (STAGE1_CONFIGURE_FLAGS): Pass
+       --disable-build-format-warnings.
+
 2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>
 
        * Makefile.def: Add libcilkrts to target_modules.  Make libcilkrts 
index 572b3d0941e425a5a334b8364ca3ad42dfc332a5..e0ba7848434aeab90b15a52e65203ffc29c60a25 100644 (file)
@@ -498,8 +498,10 @@ STAGE1_LANGUAGES = @stage1_languages@
 #   the last argument when conflicting --enable arguments are passed.
 # * Likewise, we force-disable coverage flags, since the installed
 #   compiler probably has never heard of them.
+# * We also disable -Wformat, since older GCCs don't understand newer %s.
 STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
-         --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
+         --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
+         --disable-build-format-warnings
 
 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
index 3e187e1b9dce81091856a72cdec287358134d74c..65d070b946e82a6bb68c0d0568aa80d3ed06ca25 100644 (file)
@@ -451,8 +451,10 @@ STAGE1_LANGUAGES = @stage1_languages@
 #   the last argument when conflicting --enable arguments are passed.
 # * Likewise, we force-disable coverage flags, since the installed
 #   compiler probably has never heard of them.
+# * We also disable -Wformat, since older GCCs don't understand newer %s.
 STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
-         --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
+         --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
+         --disable-build-format-warnings
 
 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
index 9965d509b10a1f964fa5412cd63160c16c4cfd4b..9907608a15092092ed361e0fcdc08798c75de5d4 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-30  Jason Merrill  <jason@redhat.com>
+
+       * configure.ac (loose_warn): Add -Wno-format if
+       --disable-build-format-warnings.
+
 2013-10-30  David Malcolm  <dmalcolm@redhat.com>
 
        * cgraphunit.c (analyze_functions): Split symtab_node
index 1e7bcb6c49a89f5a9226eb5b48ba2c130c82270d..ea9190683c5f03e9036153f5f89394b45ed78159 100755 (executable)
@@ -875,6 +875,7 @@ with_demangler_in_ld
 with_gnu_as
 with_as
 enable_largefile
+enable_build_format_warnings
 enable_werror_always
 enable_checking
 enable_coverage
@@ -1569,6 +1570,8 @@ Optional Features:
                           for creating source tarballs for users without
                           texinfo bison or flex
   --disable-largefile     omit support for large files
+  --disable-build-format-warnings
+                          don't use -Wformat while building GCC
   --enable-werror-always  enable -Werror despite compiler version
   --enable-checking[=LIST]
                           enable expensive run-time checks. With LIST, enable
@@ -6270,9 +6273,22 @@ fi
 # * C++11 narrowing conversions in { }
 # So, we only use -pedantic if we can disable those warnings.
 
+# In stage 1, disable -Wformat warnings from old GCCs about new % codes
+# Check whether --enable-build-format-warnings was given.
+if test "${enable_build_format_warnings+set}" = set; then :
+  enableval=$enable_build_format_warnings;
+else
+  enable_build_format_warnings=yes
+fi
+
+if test $enable_build_format_warnings = no; then :
+  wf_opt=-Wno-format
+else
+  wf_opt=
+fi
 loose_warn=
 save_CFLAGS="$CFLAGS"
-for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual; do
+for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual $wf_opt; do
   # Do the check with the no- prefix removed since gcc silently
   # accepts any -Wno-* option on purpose
   case $real_option in
@@ -17897,7 +17913,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 17900 "configure"
+#line 17916 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18003,7 +18019,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18006 "configure"
+#line 18022 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 5e686dbf48f4bf62f28c994fe974464510221e34..3d3b26b28a01fb6171114e9f6b8e69318929e103 100644 (file)
@@ -326,8 +326,14 @@ GCC_STDINT_TYPES
 # * C++11 narrowing conversions in { }
 # So, we only use -pedantic if we can disable those warnings.
 
+# In stage 1, disable -Wformat warnings from old GCCs about new % codes
+AC_ARG_ENABLE(build-format-warnings,
+  AS_HELP_STRING([--disable-build-format-warnings],[don't use -Wformat while building GCC]),
+  [],[enable_build_format_warnings=yes])
+AS_IF([test $enable_build_format_warnings = no],
+      [wf_opt=-Wno-format],[wf_opt=])
 ACX_PROG_CC_WARNING_OPTS(
-       m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual])), [loose_warn])
+       m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual $wf_opt])), [loose_warn])
 ACX_PROG_CC_WARNING_OPTS(
        m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])),
        [c_loose_warn])