From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32523 invoked by alias); 18 Apr 2006 09:13:04 -0000 Received: (qmail 32509 invoked by uid 22791); 18 Apr 2006 09:13:04 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 18 Apr 2006 09:13:02 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k3I9CwEg008638 for ; Tue, 18 Apr 2006 11:12:58 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k3I9Cvmg015005 for ; Tue, 18 Apr 2006 11:12:57 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k3I9Cvra015638; Tue, 18 Apr 2006 11:12:57 +0200 (CEST) Date: Tue, 18 Apr 2006 09:40:00 -0000 Message-Id: <200604180912.k3I9Cvra015638@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: binutils@sourceware.org Subject: Silence compiler warning on Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00221.txt.bz2 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 * 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"),