public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Silence compiler warning on
@ 2006-04-18  9:40 Mark Kettenis
  2006-04-18 23:50 ` Ian Lance Taylor
  2006-05-04 18:39 ` Daniel Jacobowitz
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Kettenis @ 2006-04-18  9:40 UTC (permalink / raw)
  To: binutils

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  <kettenis@jive.nl>

        * bfd.c (_bfd_abort): Provide prototype for _exit with
        ATTRIBUTE_NORETURN.

Index: bfd.c
===================================================================
RCS file: /cvs/src/src/bfd/bfd.c,v
retrieving revision 1.81
diff -u -p -r1.81 bfd.c
--- bfd.c	16 Mar 2006 12:20:15 -0000	1.81
+++ bfd.c	18 Apr 2006 08:58:52 -0000
@@ -783,6 +783,9 @@ bfd_assert (const char *file, int line)
 void
 _bfd_abort (const char *file, int line, const char *fn)
 {
+  /* Make sure the compiler knows _exit doesn't return.  */
+  extern void _exit (int) ATTRIBUTE_NORETURN;
+
   if (fn != NULL)
     (*_bfd_error_handler)
       (_("BFD %s internal error, aborting at %s line %d in %s\n"),

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-05-05 12:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-18  9:40 Silence compiler warning on Mark Kettenis
2006-04-18 23:50 ` Ian Lance Taylor
2006-04-19  7:44   ` Mark Kettenis
2006-04-19  8:22     ` Ian Lance Taylor
2006-05-04 18:39 ` Daniel Jacobowitz
2006-05-05 12:20   ` Mark Kettenis
2006-05-05 13:07     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).