This is the mail archive of the
mailing list for the binutils project.
Re: Silence compiler warning on
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: drow at false dot org
- Cc: binutils at sourceware dot org
- Date: Fri, 5 May 2006 11:41:18 +0200 (CEST)
- Subject: Re: Silence compiler warning on
- References: <200604180912.k3I9Cvra015638@elgar.sibelius.xs4all.nl> <20060504183930.GA6506@nevyn.them.org>
> Date: Thu, 4 May 2006 14:39:30 -0400
> From: Daniel Jacobowitz <firstname.lastname@example.org>
> On Tue, Apr 18, 2006 at 11:12:57AM +0200, Mark Kettenis wrote:
> > Right now, when I compile BFD on HP-UX 10.20, I get the following
> > warning (wich is fatal because of -Werror):
> > /export/jive/kettenis/src/gdb/bfd/bfd.c: In function `_bfd_abort':
> > /export/jive/kettenis/src/gdb/bfd/bfd.c:801: warning: `noreturn' function does return
> > The problem here is that the system headers don't declare _exit() with
> > __attribute__((noreturn). Previously we didn't get this warning
> > because _bfd_abort() called xexit(), which was declared with
> > __attribute__((noreturn)) (and xexit.c was compiled without -Werror).
> > The attached patch is an attempt to fix this. Ok?
> > Index: ChangeLog
> > from Mark Kettenis <email@example.com>
> > * bfd.c (_bfd_abort): Provide prototype for _exit with
> > ATTRIBUTE_NORETURN.
> I would like this fixed before binutils 2.17. Does something like this
> work for you?
Unfortunately not :(
configure:11800: checking if we can redeclare _exit
configure:11821: gcc -c -g -O2 conftest.c >&5
conftest.c:80: ../include/ansidecl.h: No such file or directory
However, it seems that this only happens with GCC 2.95.3 (and probably
older versions). Newer GCC versions seem to be aware of the fact that
_exit() will never return. Perhaps people should just upgrade to a
newer GCC or use --disable-werror.
There is another nasty configure issue on HP-UX 10.20 though. I'll
try to finish the patch I was working on today.
> 2006-05-04 Daniel Jacobiwtz <firstname.lastname@example.org>
> * configure.in: Check if _exit with ATTRIBUTE_NORETURN is OK.
> * bfd.c (_bfd_abort): Handle USE_EXIT_NORETURN.
> * configure, config.in: Regenerated.