Date: Wed, 11 Mar 1998 13:37:26 +0200 (IST) From: Eli Zaretskii To: Hans-Bernhard Broeker cc: Nate Eldredge , djgpp workers list Subject: Re: errno constants in In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 11 Mar 1998, Hans-Bernhard Broeker wrote: > In other words: it's always an lvalue, but not necessarily a simple > variable. > > > The scheme I saw suggested was to do: > > > > errno = 0; /* or EOK */ > > y = sqrt(x); > > if (errno == EDOM) ... > > This scheme happens to be explained in the following footnote in the > Standard, yes. But then, there *have* to be better ways of handling such > conditions. Even though errno is an lvalue, it still makes sense to not assign anything BUT ZERO to it. For example, if we have #define errno (*get_errno_value()) then "errno = 0;" is OK, but "errno = EACCES;" is *not*. I gather that is the reason for those "errno should be read-only" comments I've seen.