🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #4519

Re: errno.h problems in DEC 'C'

#4519
From: David Claude Brown
Date: Thu, 03 Aug 1995 08:57
36 lines
1704 bytes
In article <3vo921$n4a@pheidippides.axion.bt.co.uk> thomasgd@boat.bt.com (Greg Thomas) writes:

>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 ...

[snip]

>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?

DEC are allowed to do this. Paraphrasing the standard ("Reserved Identifiers" 
and "Errors <errno.h>")

  -   when <errno.h> is included, the identifier 'errno' is a reserved
      identifier.

  -   errno may be a macro; regardless it must result in a modifiable
      lvalue of type 'int'

They even give an example in a footnote not unlike DEC's implmentation.

Claude.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 vv    vv       David Claude Brown
 ||----||  *    brown@falam.ch
 ||     | /
 /\------/
(oo)
(~~)
Technical Details
Message-ID: <brown.310.000AF117@falam.ch>
Path: arc1-ca.pugleaf.net!brown.dial.eunet.ch!brown
References: <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!brown.dial.eunet.ch!brown
From: brown@falam.ch (David Claude Brown)
Subject: Re: errno.h problems in DEC 'C'
Message-ID: <brown.310.000AF117@falam.ch>
Sender: usenet@eunet.ch
Organization: Falam Holdings Pty Ltd
X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
References:  <3vo921$n4a@pheidippides.axion.bt.co.uk>
Date: Thu, 3 Aug 1995 08:57:25 GMT