This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: err.h declarations not marked noreturn.


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.

> 
> Mine looks like so (Ubuntu):
> 
> 	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.

> 
> 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.

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

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]