On 2012/5/17 01:55 AM, Manuel López-Ibáñez wrote: >> I'm guessing these changes are the cause of a full C bootstrap >> > (--disable-build-poststage1-with-cxx) failure I'm seeing on trunk. The >> > *_handle_option_auto function prototypes are not seen in options.c, and >> > -Werror -Wmissing-prototypes are in effect (oddly, such strict checking >> > is not enforced in the default post-stage1 C++ bootstrap) > Yep, We should add -Wmissing-declarations to the post-stage1 flags, > which also exists in C. Could you also add that to your patch? >
I'm a little unsure of how -Wmissing-declarations vs -Wmissing-prototypes behave for C? Anyways here's a patch to add -Wmissing-declarations for C++, keeping C as is. Joseph, how does this look? It makes the default post-stage1 C++ bootstrap fail similarly without the other options.c Makefile change, so I guess it works as intended. I'll commit both changes together once approved. Thanks, Chung-Lin 2012-05-18 Chung-Lin Tang <clt...@codesourcery.com> * configure.ac: Check for -Wmissing-declarations for C++. * configure: Regenerate. * Makefile.in (CXX_LOOSE_WARN): Set to @cxx_loose_warn@. (GCC_WARN_CXXFLAGS): Add $(CXX_LOOSE_WARN).
Index: configure.ac =================================================================== --- configure.ac (revision 187624) +++ configure.ac (working copy) @@ -347,6 +347,8 @@ ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])), [c_loose_warn]) ACX_PROG_CC_WARNING_OPTS( + m4_quote(m4_do([-Wmissing-declarations])), [cxx_loose_warn]) +ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wmissing-format-attribute])), [strict_warn]) ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn]) Index: Makefile.in =================================================================== --- Makefile.in (revision 187624) +++ Makefile.in (working copy) @@ -157,6 +157,7 @@ coverageexts = .{gcda,gcno} # C_STRICT_WARN is similar, with C-only warnings. LOOSE_WARN = @loose_warn@ C_LOOSE_WARN = @c_loose_warn@ +CXX_LOOSE_WARN = @cxx_loose_warn@ STRICT_WARN = @strict_warn@ C_STRICT_WARN = @c_strict_warn@ @@ -188,7 +189,7 @@ VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@ .-warn = $(STRICT_WARN) build-warn = $(STRICT_WARN) GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn) -GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn) +GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $(CXX_LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn) # These files are to have specific diagnostics suppressed, or are not to # be subject to -Werror: