prototypes ld/

Andreas Jaeger aj@suse.de
Fri Aug 10 02:40:00 GMT 2001


Alan Modra <amodra@bigpond.net.au> writes:

> On Fri, Aug 10, 2001 at 12:38:42AM +0930, Alan Modra wrote:
> > On Thu, Aug 09, 2001 at 04:51:17PM +0200, Andreas Jaeger wrote:
>> > 
>> > Shouldn't we add -Wstrict-prototypes to WARN_CFLAGS to catch these?
>
> -Wmissing-prototypes too
>
>> > Here's an untested patch for gas.  If this is ok, I can send similar
>> > patches for binutils, bfd and ld.
>> 
>> Hmm, gas/as.h will generate complaints about it's alloca declaration.
>> I'm not sure it's a good idea.
>
> Actually, it probably is a good idea for bfd, opcodes, binutils and ld,
> just not gas with the current as.h.  Please test it first though; I can
> throw together a patch to do this about as quickly as I can apply one of
> your patches, but testing can take a little time.  Make sure to run the
> testsuite too.  ld testsuite fails with -Wstrict-prototypes in CFLAGS,
> but should be OK in WARN_CFLAGS.

Here's a tested patch.  I run
/cvs/binutils/configure --prefix=/opt/binutils --enable-shared \
--disable-nls \
--enable-build-warnings --enable-targets=all --enable-64-bit-bfd

on i686-linux with gcc 2.95.3 and then make;make check - everything
worked fine.

Alan, The patch includes gas since you fixed the as.h.

Ok to commit the patch - together with regenerated configure files?

Andreas

2001-08-10  Andreas Jaeger  <aj@suse.de>

	* configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes
	to build warnings.

============================================================
Index: bfd/configure.in
--- bfd/configure.in	2001/05/25 22:50:27	1.52
+++ bfd/configure.in	2001/08/10 09:39:02
@@ -50,7 +50,7 @@ AC_ARG_WITH(mmap,
   *)    AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;;
 esac],[want_mmap=false])dnl
 
-build_warnings="-W -Wall"
+build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 AC_ARG_ENABLE(build-warnings,
 [  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
 [case "${enableval}" in
============================================================
Index: binutils/configure.in
--- binutils/configure.in	2001/08/03 16:27:22	1.23
+++ binutils/configure.in	2001/08/10 09:39:02
@@ -29,7 +29,7 @@ AC_ARG_ENABLE(commonbfdlib,
   *)   AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
 esac])dnl
 
-build_warnings="-W -Wall"
+build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 AC_ARG_ENABLE(build-warnings,
 [  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
 [case "${enableval}" in
============================================================
Index: gas/configure.in
--- gas/configure.in	2001/07/14 14:44:39	1.72
+++ gas/configure.in	2001/08/10 09:39:02
@@ -44,7 +44,7 @@ esac])dnl
 
 using_cgen=no
 
-build_warnings="-W -Wall"
+build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 AC_ARG_ENABLE(build-warnings,
 [  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
 [case "${enableval}" in
============================================================
Index: ld/configure.in
--- ld/configure.in	2001/02/27 06:43:55	1.13
+++ ld/configure.in	2001/08/10 09:39:02
@@ -29,7 +29,7 @@ AC_ARG_ENABLE(64-bit-bfd,
   *)    AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
 esac],[want64=false])dnl
 
-build_warnings="-W -Wall"
+build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 AC_ARG_ENABLE(build-warnings,
 [  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
 [case "${enableval}" in
============================================================
Index: opcodes/configure.in
--- opcodes/configure.in	2001/06/10 14:07:12	1.21
+++ opcodes/configure.in	2001/08/10 09:39:02
@@ -43,7 +43,7 @@ AC_ARG_ENABLE(commonbfdlib,
   *)   AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;;
 esac])dnl
 
-build_warnings="-W -Wall"
+build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
 AC_ARG_ENABLE(build-warnings,
 [  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
 [case "${enableval}" in

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Binutils mailing list