|
|
Flash Gordon wrote:
Herbert Rosenau wrote, On 31/03/08 20:22:
On Sat, 29 Mar 2008 17:44:21 UTC, Ioannis Vranos
<ivranos@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
"register" is part of the language standard, if a compiler considers it
unneeded, it is free to ignore it. Proper uses of "register" making the
compiler to produce less-efficient code than not using it at all, is a
compiler-defect.
Yes, but since C98/99 its free to the compiler simply ignoring
'register'. That means it is the right to the compiler to replace the
keyword register with white space.
Not quite. If you attempt to take the address of a register variable the
compiler is required to produce a diagnostic. Apart from that, just it
can ignore it.
Another corner case:
int x = 42;
int f(void) {
register x = 27;
return x;
}
int g(void) {
/*register*/ x = 27;
return x;
}
The two functions do different things.
--
Eric.Sosman@xxxxxxx
|
|