From owner-freebsd-hackers Sun Nov 22 10:13:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA27802 for freebsd-hackers-outgoing; Sun, 22 Nov 1998 10:13:28 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from detlev.UUCP (29-sweet.camalott.com [208.239.153.29]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA27627; Sun, 22 Nov 1998 10:13:09 -0800 (PST) (envelope-from joelh@gnu.org) Received: (from joelh@localhost) by detlev.UUCP (8.9.1/8.9.1) id MAA13668; Sun, 22 Nov 1998 12:12:29 -0600 (CST) (envelope-from joelh) To: nectar@FreeBSD.ORG Cc: hackers@FreeBSD.ORG Subject: Re: errno References: From: Joel Ray Holveck Date: 22 Nov 1998 12:12:25 -0600 In-Reply-To: nectar@FreeBSD.ORG's message of "Sun, 22 Nov 1998 10:04:21 -0600 (CST)" Message-ID: <86yap3oauu.fsf@detlev.UUCP> Lines: 24 X-Mailer: Gnus v5.5/Emacs 20.3 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > The following code snippet won't compile on -CURRENT, or on -STABLE with > _THREAD_SAFE defined due to ``errno'' being a macro in : > #include > 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