This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type based aliasing again
Mark Mitchell wrote:
[ C aliasing-or-not-determined-by-type-of-pointee-vs-pointer ]
> Just to clarify, the language in the standard probably dates to the
> original C standard. It is certainly not a new aspect of C9X.
But was it new with the ANSI/ISO 89 Standard ?
> That doesn't have any bearing on our decision about what to do; it's
> just a fact. This is not a change to the standard that GCC rushed to
> take advantage of; it's a long-standing aspect of ANSI/ISO C.
[ I do agree with the first sentence of of the above paragraph ]
The interesting question preceding is: Did C programmers *ever* have
the opportunity to believe that the following sequence would work:
int bla(ix)
int *ix;
{
short s;
...
s = (short *) ix;
...
}
I reread K&R II (Chapter 5 "Pointers and Arrays" and Appendix C "Summary
of Changes") and nowhere they say these restrictions against using
differently typed pointers "are new with the ANSI/ISO Standard".
I don't have K&R I, so I can't check if you could possibly read into
that text that the above would be legal, or what it would mean in the
first place ...
Does anyone know this ?
--
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://gcc.gnu.org/onlinedocs/g77_news.html