Article View: comp.std.c
Article #5630A glitch for "register"
From: T. William Wells
Date: Tue, 17 Jan 1989 20:50
Date: Tue, 17 Jan 1989 20:50
36 lines
1408 bytes
1408 bytes
I just noticed something. The dpANS (May 88) says that `&' can't be
applied to a register variable. However, it does not say, except in a
footnote, that
register int a[4];
a[0] = 0;
is illegal. And footnotes are not part of the standard. This is an
obvious oversight, parhaps fixed in the latest? (Or perhaps I just
miseed where they said it?)
However, that is not the glitch I had in mind. Consider this:
register struct {
int foo;
} bletch;
int *ptr;
ptr = &bletch.foo;
It does not seem to violate the standard, though obviously it should.
Here is what the May 88 standard says: (3.3.3.2)
"The operand [of &] ... shall be ... an lvalue that designates an
object that ... is not declared with the register storage-class
specifier."
It seems to need an additional clause saying something like "and is
not contained within an object declared with the register
storage-class specifier".
---
Bill
{ uunet!proxftl | novavax } !twwells!bill
Technical Details
Message-ID:
<335@twwells.uucp>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!mailrus!uflorida!novavax!twwells!billShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!mailrus!uflorida!novavax!twwells!bill From: bill@twwells.uucp (T. William Wells) Newsgroups: comp.std.c Subject: A glitch for "register" Message-ID: <335@twwells.uucp> Date: 17 Jan 89 20:50:11 GMT Reply-To: bill@twwells.UUCP (T. William Wells) Organization: None, Ft. Lauderdale Lines: 36