Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Nov 1998 19:27:25 +0200 (SAT)
From:      Robert Nordier <rnordier@nordier.com>
To:        nectar@FreeBSD.ORG
Cc:        hackers@FreeBSD.ORG
Subject:   Re: errno
Message-ID:  <199811221727.TAA07219@ceia.nordier.com>
In-Reply-To: <XFMail.981122100421.nectar@FreeBSD.ORG> from "nectar@FreeBSD.ORG" at "Nov 22, 98 10:04:21 am"

next in thread | previous in thread | raw e-mail | index | archive | help
nectar@FreeBSD.ORG wrote:
 
> 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.

    7.1.4: .... It is unspecified whether errno is a macro or an
    identifier declared with external linkage.  If a macro definition
    is suppressed in order to access an actual object, or a program
    defines an identifier with the name errno, the behavior is
    undefined.

-- 
Robert Nordier

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?199811221727.TAA07219>