https://gcc.sashiko.dev/#/patchset/20261116234048.2827378-1-kaelfandrew%40gmail.com
My patch remove -pedantic and c_warn was left in (which is undefined).
I posted a new patch which remove more C-only vars in Makefile and configure:
https://gcc.gnu.org/pipermail/gcc-patches/2026-November/739514.html

On Mon, Nov 16, 2026 at 6:50 PM Andrea Pinski
<[email protected]> wrote:
>
> On Mon, Nov 16, 2026 at 3:41 PM Kael Andrew Franco
> <[email protected]> wrote:
> >
> > libcpp has no C files so remove C-only -W* options.
> > -Wno-long-long is redundant since libcpp needs C++14.
>
> Most of these have been redundant for a lot longer than the move to C++14.
> Like -Wno-long-long has been redundant since the move to C++11.
>
> Ok.
>
> >
> > Bootstrapped on x86_64-pc-linux-gnu.
> >
> >         PR bootstrap/112422
> >
> > libcpp/ChangeLog:
> >
> >         * configure.ac (-Wstrict-prototypes): Remove.
> >         (-Wmissing-prototypes): Ditto.
> >         (-Wold-style-definition): Ditto.
> >         (-Wc++-compat): Ditto.
> >         (-Wno-long-long): Ditto.
> >         * configure: Regenerate.
> >         * Makefile.in (WARN_PEDANTIC): Remove.
> > ---
> >  libcpp/Makefile.in  |   4 +-
> >  libcpp/configure    | 110 --------------------------------------------
> >  libcpp/configure.ac |   3 --
> >  3 files changed, 2 insertions(+), 115 deletions(-)
> >
> > diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
> > index ba4b44b9436..0d2a6eb707b 100644
> > --- a/libcpp/Makefile.in
> > +++ b/libcpp/Makefile.in
> > @@ -33,10 +33,10 @@ AUTOHEADER = @AUTOHEADER@
> >  CATALOGS = $(patsubst %,po/%,@CATALOGS@)
> >  CC = @CC@
> >  CFLAGS = @CFLAGS@
> > -WARN_CFLAGS = @warn@ @c_warn@ @WARN_PEDANTIC@ @WERROR@
> > +WARN_CFLAGS = @warn@ @c_warn@ @WERROR@
> >  CXX = @CXX@
> >  CXXFLAGS = @CXXFLAGS@
> > -WARN_CXXFLAGS = @warn@ @WARN_PEDANTIC@ @WERROR@
> > +WARN_CXXFLAGS = @warn@ @WERROR@
> >  CPP = @CPP@
> >  CPPFLAGS = @CPPFLAGS@
> >  EXEEXT = @EXEEXT@
> > diff --git a/libcpp/configure b/libcpp/configure
> > index b2493f14aeb..b267c382e61 100755
> > --- a/libcpp/configure
> > +++ b/libcpp/configure
> > @@ -658,8 +658,6 @@ DEPDIR
> >  am__leading_dot
> >  WERROR
> >  noexception_flags
> > -WARN_PEDANTIC
> > -c_warn
> >  warn
> >  ETAGS
> >  AUTOHEADER
> > @@ -5026,114 +5024,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS 
> > $CPPFLAGS $LDFLAGS conftest.$ac_ext $
> >  ac_compiler_gnu=$ac_cv_c_compiler_gnu
> >
> >
> > -ac_ext=c
> > -ac_cpp='$CPP $CPPFLAGS'
> > -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
> > -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS 
> > conftest.$ac_ext $LIBS >&5'
> > -ac_compiler_gnu=$ac_cv_c_compiler_gnu
> > -
> > -c_warn=
> > -save_CFLAGS="$CFLAGS"
> > -for real_option in -Wstrict-prototypes -Wmissing-prototypes \
> > -                         -Wold-style-definition -Wc++-compat; do
> > -  # Do the check with the no- prefix removed since gcc silently
> > -  # accepts any -Wno-* option on purpose
> > -  case $real_option in
> > -    -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
> > -    *) option=$real_option ;;
> > -  esac
> > -  as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
> > -
> > -  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports 
> > $option" >&5
> > -$as_echo_n "checking whether $CC supports $option... " >&6; }
> > -if eval \${$as_acx_Woption+:} false; then :
> > -  $as_echo_n "(cached) " >&6
> > -else
> > -  CFLAGS="$option"
> > -    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> > -/* end confdefs.h.  */
> > -
> > -int
> > -main ()
> > -{
> > -
> > -  ;
> > -  return 0;
> > -}
> > -_ACEOF
> > -if ac_fn_c_try_compile "$LINENO"; then :
> > -  eval "$as_acx_Woption=yes"
> > -else
> > -  eval "$as_acx_Woption=no"
> > -fi
> > -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> > -
> > -fi
> > -eval ac_res=\$$as_acx_Woption
> > -              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
> > -$as_echo "$ac_res" >&6; }
> > -  if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; 
> > then :
> > -  c_warn="$c_warn${c_warn:+ }$real_option"
> > -fi
> > -  done
> > -CFLAGS="$save_CFLAGS"
> > -ac_ext=c
> > -ac_cpp='$CPP $CPPFLAGS'
> > -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
> > -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS 
> > conftest.$ac_ext $LIBS >&5'
> > -ac_compiler_gnu=$ac_cv_c_compiler_gnu
> > -
> > -
> > -ac_ext=c
> > -ac_cpp='$CPP $CPPFLAGS'
> > -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
> > -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS 
> > conftest.$ac_ext $LIBS >&5'
> > -ac_compiler_gnu=$ac_cv_c_compiler_gnu
> > -
> > -WARN_PEDANTIC=
> > -# Do the check with the no- prefix removed from the warning options
> > -# since gcc silently accepts any -Wno-* option on purpose
> > -if test "$GCC" = yes; then :
> > -  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports 
> > -pedantic -Wlong-long" >&5
> > -$as_echo_n "checking whether $CC supports -pedantic -Wlong-long... " >&6; }
> > -if ${acx_cv_prog_cc_pedantic__Wlong_long+:} false; then :
> > -  $as_echo_n "(cached) " >&6
> > -else
> > -  save_CFLAGS="$CFLAGS"
> > -CFLAGS="-pedantic -Wlong-long"
> > -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> > -/* end confdefs.h.  */
> > -
> > -int
> > -main ()
> > -{
> > -
> > -  ;
> > -  return 0;
> > -}
> > -_ACEOF
> > -if ac_fn_c_try_compile "$LINENO"; then :
> > -  acx_cv_prog_cc_pedantic__Wlong_long=yes
> > -else
> > -  acx_cv_prog_cc_pedantic__Wlong_long=no
> > -fi
> > -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> > -CFLAGS="$save_CFLAGS"
> > -fi
> > -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
> > $acx_cv_prog_cc_pedantic__Wlong_long" >&5
> > -$as_echo "$acx_cv_prog_cc_pedantic__Wlong_long" >&6; }
> > -if test $acx_cv_prog_cc_pedantic__Wlong_long = yes; then :
> > -  WARN_PEDANTIC="$WARN_PEDANTIC${WARN_PEDANTIC:+ }-pedantic -Wno-long-long"
> > -fi
> > -
> > -fi
> > -ac_ext=c
> > -ac_cpp='$CPP $CPPFLAGS'
> > -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
> > -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS 
> > conftest.$ac_ext $LIBS >&5'
> > -ac_compiler_gnu=$ac_cv_c_compiler_gnu
> > -
> > -
> >
> >  # Disable exceptions and RTTI if building with g++
> >  ac_ext=c
> > diff --git a/libcpp/configure.ac b/libcpp/configure.ac
> > index 9e1ef1e1116..c15ed164a4c 100644
> > --- a/libcpp/configure.ac
> > +++ b/libcpp/configure.ac
> > @@ -32,9 +32,6 @@ AC_SUBST([ETAGS])
> >
> >  ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wno-narrowing -Wwrite-strings \
> >                           -Wmissing-format-attribute], [warn])
> > -ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \
> > -                         -Wold-style-definition -Wc++-compat], [c_warn])
> > -ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
> >
> >  # Disable exceptions and RTTI if building with g++
> >  ACX_PROG_CC_WARNING_OPTS(
> > --
> > 2.56.0
> >

Reply via email to