This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Fix Werror flag test ; Was: gdb-20011002/gdb/configure
- To: gdb-patches at sources dot redhat dot com
- Subject: [patch] Fix Werror flag test ; Was: gdb-20011002/gdb/configure
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Sun, 14 Oct 2001 16:47:01 -0400
- Cc: Quality Quorum <qqi at world dot std dot com>
- References: <Pine.SGI.4.30.0110091347580.6728-100000@world.std.com>
> Hi,
>
> I found a bug in gdb-20011002/gdb/configure.in, line 748 .
>
> When you execute 'gcc -Wzzz' it will bark
> "gcc: No inout files specified", when
> you execute 'gcc -Wzzz dummy.c' it will bark
> "cc1: Invalid option `-Wzzz'"
>
> So, in order to verify whether a particular option
> is acceptable one has to (1) provide input file,
> (2) do grep on correct string.
I'm sure it worked once. Anyway, the attached should fix this. I'll
check it into the trunk but not the 5.1 branch. As far as I can tell
you would only trip up on this if a --enable-gdb-build-warning flag was
specified.
Andrew
2001-10-14 Andrew Cagney <ac131313@redhat.com>
* configure.in (WERROR_CFLAGS): Use AC_TRY_COMPILE to test the
-W... flags.
* configure: Re-generate.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.72
diff -p -r1.72 configure.in
*** configure.in 2001/09/06 20:59:18 1.72
--- configure.in 2001/10/14 20:38:58
*************** then
*** 746,756 ****
case $w in
-Werr*) WERROR_CFLAGS=-Werror ;;
*) # Check that GCC accepts it
! if $CC $w 2>&1 | grep 'unrecognized option' > /dev/null; then
! :
! else
! WARN_CFLAGS="${WARN_CFLAGS} $w"
! fi
esac
done
AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS})
--- 746,755 ----
case $w in
-Werr*) WERROR_CFLAGS=-Werror ;;
*) # Check that GCC accepts it
! saved_CFLAGS="$CFLAGS"
! CFLAGS="$CFLAGS $w"
! AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
! CFLAGS="$saved_CFLAGS"
esac
done
AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS})