Article View: comp.sys.dec
Article #4516Re: errno.h problems in DEC 'C'
From: Dan Pop
Date: Wed, 02 Aug 1995 23:49
Date: Wed, 02 Aug 1995 23:49
48 lines
2044 bytes
2044 bytes
In <3vo921$n4a@pheidippides.axion.bt.co.uk> thomasgd@boat.bt.com (Greg Thomas) writes:
>Hi,
>
>I'm trying to porting some code to Alpha/DEC 'C' from VAX/VAX 'C'. We have,
>however, hit a problem with the <errno.h> include file. It #defines it to be
>(*cma$tis_errno_get_addr()). The trouble is, we have number of structures that
>have an errno as an element. Of course, this gets expanded to the above
>function, and so it won't compile. ie ...
>
You got precisely what you deserved.
>Now whilst I can change all our code to not refer to errno in this structure,
>I feel that the DEC 'C' errno.h does not have correct behaviour in it. Is the
>DEC 'C' compiler in error (my K&R 2nd Ed does refer to errno as an integer,
>but that's all), or am I not allowed to do this?
It's all your fault. Here's the relevant part of the standard:
4.1.3 Errors <errno.h>
The header <errno.h> defines several macros, all relating to the
reporting of error conditions.
The macros are
^^^^^^
EDOM
ERANGE
which expand to distinct nonzero integral constant expressions; and
errno
which expands to a modifiable lvalue that has type int...
^^^^^^^
(*cma$tis_errno_get_addr()) looks like a modifiable lvalue, so the
implementation is correct (the cma$tis_errno_get_addr symbol is
definitely not in the user's namespace).
Time to fix your code.
Dan
--
Dan Pop
CERN, CN Division
Email: Dan.Pop@mail.cern.ch
Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
Technical Details
Message-ID:
<danpop.807407394@rscernix>Path:
arc1-ca.pugleaf.net!CERN.ch!rscernix!danpopReferences:
<3vo921$n4a@pheidippides.axion.bt.co.uk>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.dec,comp.lang.c Path: arc1-ca.pugleaf.net!CERN.ch!rscernix!danpop From: Dan.Pop@mail.cern.ch (Dan Pop) Subject: Re: errno.h problems in DEC 'C' X-Nntp-Posting-Host: ues5.cern.ch Message-ID: <danpop.807407394@rscernix> Sender: news@news.cern.ch (USENET News System) Organization: CERN European Lab for Particle Physics X-Newsreader: NN version 6.5.0 #9 (NOV) References: <3vo921$n4a@pheidippides.axion.bt.co.uk> Date: Wed, 2 Aug 1995 23:49:54 GMT