🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2700

Re: volatile and typedef

#2700
From: Norman Diamond
Date: Mon, 08 Apr 1991 01:51
39 lines
2210 bytes
In article <13698@adobe.UUCP> taft@adobe.COM writes:
>  typedef int *int_ptr;
>  int_ptr pi;
>  volatile int_ptr vpi;
>  int test() {
>    vpi = pi;
>    return *vpi;
>  }
>My understanding is that the volatile type qualifier refers only to the
>variable vpi (used as an lvalue) and not to the thing it points to.
Mine too.  (Personal opinion.)

>This compiler does not claim to be ANSI-compliant,
>but it does support the volatile type qualifier
[Two incorrect warning messages.]
The warnings give the impression that it does not support volatile ... but ...
>The correct code appears to be generated in spite of the warnings.
... ah, so it does support volatile (as far as you and I know so far).

>Is the compiler wrong to complain about this usage,

An ANSI-compliant compiler may give any spurious error messages that it
wishes, as long as it correctly processes a strictly conforming program.
So, even an ANSI-conforming compiler could give the two incorrect warnings
that you quoted.

A non-ANSI-conforming compiler can do whatever it wants.

This non-ANSI-conforming compiler seems to come fairly close to conforming.

In both cases, quality of implementation is different from requirements.
If you tell your vendor that their product has an error, they might agree.
(Sorry, I don't know how to maximize the chance that they will agree.)

>or does the program really violate the standard in some way?
As far as I can see, the program does not violate the standard.
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Technical Details
Message-ID: <1991Apr8.015144.2198@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit345!diamond
References: <13698@adobe.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit345!diamond
From: diamond@jit345.swstokyo.dec.com (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: volatile and typedef
Message-ID: <1991Apr8.015144.2198@tkou02.enet.dec.com>
Date: 8 Apr 91 01:51:44 GMT
References: <13698@adobe.UUCP>
Sender: usenet@tkou02.enet.dec.com (USENET News System)
Reply-To: diamond@jit345.enet@tkou02.enet.dec.com (Norman Diamond)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 39