[RFC] Change configure.in so -W arnings match reality

Andrew Cagney ac131313@cygnus.com
Wed Apr 19 02:07:00 GMT 2000


David Whedon wrote:
> 
> I'm building the gdb 5.0 branch on our sgi and it has a problem with the
> warning flags.
> 
> This error, I believe, is caused by this patch.
> ( http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00276.html )
> My problem would be fixed if -Wreturn-type is removed from gdb/configure.in
> (see the patch for more info)
> 
> I think it is because I am using an old gcc (October '99)

That isn't old.

	$ gcc --version
	2.7.2.3
	$ gcc -Wreturn-type hello.c
	hello.c:2: warning: return-type defaults to `int'

is old :-)  I'm actually slightly puzzled by this problem.  The
-Wreturn-type option is very old.

Anyway, I've applied the attached to the branch. But _not_ the trunk.

	Andrew
Wed Apr 19 18:05:24 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* configure.in (build_warnings): Default to warnings disabled.
	* configure: Re-generate.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.18.2.2
diff -p -r1.18.2.2 configure.in
*** configure.in	2000/04/14 10:40:00	1.18.2.2
--- configure.in	2000/04/19 08:59:55
*************** if test "${enable_netrom}" = "yes"; then
*** 482,489 ****
  fi
  
  
! build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
  -Wformat -Wparentheses -Wpointer-arith"
  # Not yet: -Wall -Wpointer-arith -Wstrict-prototypes
  # -Wmissing-prototypes -Wmissing-declarations
  AC_ARG_ENABLE(build-warnings,
--- 482,490 ----
  fi
  
  
! default_build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
  -Wformat -Wparentheses -Wpointer-arith"
+ build_warnings=""
  # Not yet: -Wall -Wpointer-arith -Wstrict-prototypes
  # -Wmissing-prototypes -Wmissing-declarations
  AC_ARG_ENABLE(build-warnings,
*************** AC_ARG_ENABLE(build-warnings,
*** 492,500 ****
    yes)	;;
    no)	build_warnings="-w";;
    ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
!         build_warnings="${build_warnings} ${t}";;
    *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
!         build_warnings="${t} ${build_warnings}";;
    *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
  esac
  if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
--- 493,501 ----
    yes)	;;
    no)	build_warnings="-w";;
    ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
!         build_warnings="${default_build_warnings} ${t}";;
    *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
!         build_warnings="${t} ${default_build_warnings}";;
    *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
  esac
  if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then


More information about the Gdb-patches mailing list