Skip site navigation (1)Skip section navigation (2)
Date:      22 Nov 1998 12:12:25 -0600
From:      Joel Ray Holveck <joelh@gnu.org>
To:        nectar@FreeBSD.ORG
Cc:        hackers@FreeBSD.ORG
Subject:   Re: errno
Message-ID:  <86yap3oauu.fsf@detlev.UUCP>
In-Reply-To: nectar@FreeBSD.ORG's message of "Sun, 22 Nov 1998 10:04:21 -0600 (CST)"
References:  <XFMail.981122100421.nectar@FreeBSD.ORG>

next in thread | previous in thread | raw e-mail | index | archive | help
> The following code snippet won't compile on -CURRENT, or on -STABLE with
> _THREAD_SAFE defined due to ``errno'' being a macro in <errno.h>:
>   #include <errno.h>
>   struct example {
>     int errno;
>   };
> I understand why, but is this code incorrect ANSI C?  I'm just
> trying to find a reference that prohibits this use.

This may be better in comp.lang.c.

The way I understand it, errno is explicitly allowed to be defined as
a macro evaluating to a modifiable lvalue.  I don't have a C standard
handy, but I'm nearly (95%) certain that the ISO standard allows our
macro.  I don't know about ANSI, but it is usually the same.

Happy hacking,
joelh

-- 
Joel Ray Holveck - joelh@gnu.org
   Fourth law of programming:
   Anything that can go wrong wi
sendmail: segmentation violation - core dumped

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86yap3oauu.fsf>