delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/02/01/18:45:34

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4D489B12.4080807@redhat.com>
Date: Tue, 01 Feb 2011 16:45:22 -0700
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: err.h declarations not marked noreturn.
References: <AANLkTimhvza1E0bj7EmBURK+Sc22R9x265sjLdVxeNAw AT mail DOT gmail DOT com> <201102011259 DOT 53193 DOT rusty AT rustcorp DOT com DOT au> <AANLkTimViNGmPH0q8h1gASOYiD1mYqowDRJTecAbx+1O AT mail DOT gmail DOT com> <201102020911 DOT 31282 DOT rusty AT rustcorp DOT com DOT au>
In-Reply-To: <201102020911.31282.rusty@rustcorp.com.au>
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------enig85FFF0BDE383A278B2777D09
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

On 02/01/2011 03:41 PM, Rusty Russell wrote:
> OK, your /usr/include/err.h doesn't have the annotations to tell gcc that=
 it
> doesn't return.

I'm a bit surprised that cygwin provides the BSD interface err() but
lacks the glibc interface error() from "error.h", even though both
interfaces are equally non-standard, and cygwin strives more for Linux
compatibility.  But that's besides the point.

>=20
> Mine looks like so (Ubuntu):
>=20
> 	extern void err (int __status, __const char *__format, ...)
> 	     __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));

But it is indeed the case that the BSD interface err() always calls
exit() (see cygwin/libc/bsdlib.cc in the sources), and could therefore
be marked noreturn in the headers if someone were to provide a patch.

>=20
> I've CC'd the cygwin list: there might be a good reason why they don't
> have annotations on their err.h, or it might just be an omission.

An unintentional omission, because no one has complained about it in the
past.  In fact, there are a LOT of useful gcc attributes that could be
added to various headers throughout the cygwin and newlib projects.

--=20
Eric Blake   eblake AT redhat DOT com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig85FFF0BDE383A278B2777D09
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJNSJsSAAoJEKeha0olJ0NqrXUH/1I6S9gNV7aYmM1XKUflz9JZ
rsUt678I80iJaT2IEXQ8CRjxt2Cx73hkNLwYIrWdhutjrBR5XWb8B+rU8PDz/zXw
/w6iMau5uXYlkQ+LLZwE6iRxIWxqx5fGl5OT0bc//SPmFo/Xo5qgLiVvrtFnYpLq
4CFz+L+N0LwJBd+EwiOpNyflDIBGCcJUr3u7h/zk4vCPPZIHuKSJPj8/NTKfy0+K
gN1BWt+KTRG2PwZdXXrJvVtd+ApVGvcKgY8o+T07AajiqaYOGLWytnprCGZANkx9
1byNOkTzoaVh0ZOEiuK8gJROKiRec8rSd0rYgRaR+db8DvMzq4TXTW6vGNj27v8=
=9n8B
-----END PGP SIGNATURE-----

--------------enig85FFF0BDE383A278B2777D09--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019