help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: errno bug?


From: E. Robert Tisdale
Subject: Re: errno bug?
Date: Wed, 06 Oct 2004 13:53:41 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922

Thomas Maeder wrote:

"E. Robert Tisdale" <E.Robert.Tisdale@jpl.nasa.gov> writes:


The problem is that /usr/include/bits/errno.h declares:

extern int *__errno_location (void) __THROW __attribute__ ((__const__));

but defines the C preprocessor macro:

#   define errno (*__errno_location ())


The declaration and the macro definition are inconsistent.


I don't see it.

__errno_location() evaluates to an int *, so (*__errno_location ())
evaluates to an lvalue of type int. Makes sense to me.

Is there a problem with the "__THROW __attribute__ ((__const__));" part
(which I don't understand)?

Evidently, it resolves to 'throw()' when compiled with g++ but

        extern int errno;

is replaced with

        extern int (*__errno_location ());


reply via email to

[Prev in Thread] Current Thread [Next in Thread]