From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23850 invoked by alias); 19 Apr 2006 06:47:20 -0000 Received: (qmail 23841 invoked by uid 22791); 19 Apr 2006 06:47:19 -0000 X-Spam-Check-By: sourceware.org Received: from yosemite.airs.com (HELO yosemite.airs.com) (205.217.158.180) by sourceware.org (qpsmtpd/0.31) with SMTP; Wed, 19 Apr 2006 06:47:17 +0000 Received: (qmail 24773 invoked by uid 10); 19 Apr 2006 06:47:16 -0000 Received: (qmail 13568 invoked by uid 500); 19 Apr 2006 06:47:09 -0000 Mail-Followup-To: binutils@sourceware.org, mark.kettenis@xs4all.nl To: Mark Kettenis Cc: binutils@sourceware.org Subject: Re: Silence compiler warning on References: <200604180912.k3I9Cvra015638@elgar.sibelius.xs4all.nl> <200604190635.k3J6ZoeW019852@elgar.sibelius.xs4all.nl> From: Ian Lance Taylor Date: Wed, 19 Apr 2006 08:22:00 -0000 In-Reply-To: <200604190635.k3J6ZoeW019852@elgar.sibelius.xs4all.nl> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes 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/msg00253.txt.bz2 Mark Kettenis writes: > > From: Ian Lance Taylor > > Date: 18 Apr 2006 16:13:59 -0700 > > > > Mark Kettenis writes: > > > > > Index: ChangeLog > > > from Mark Kettenis > > > > > > * bfd.c (_bfd_abort): Provide prototype for _exit with > > > ATTRIBUTE_NORETURN. > > > > I think something like this should use AC_CHECK_DECLS to avoid a > > conflict with the system header files. > > I fail to see how that would work. I'm not trying to add a missing > prototype; I'm trying to augment a prototype with a noreturn attribute. You're right, AC_CHECK_DECLS isn't the right thing to use. What is needed is some test to make sure that you can compile code with the declaration that you want to add. > A conflict with the system header files seems rather unlikely; the > only variation I could imagine, is that some (pre ISO C) header files > fail to provide the proper return type. _exit is not an ISO C function. System header files are sadly unreliable when it comes to declaring functions. If the system header file happens to declare the function in some incompatible way--say it uses unsigned int--then you will introduce a build failure. I think it's safer to use an autoconf test to see whether the prototype declaration is safe. We've had unfortunate experiences over the years with attempts to declare functions which should be declared in system header files. Ian