Are all structure pointers grey in the dark?
Mike Schilling
mikes at ingres.com
Thu May 30 02:16:02 AEST 1991
>From article <1991May28.115914.19879 at email.tuwien.ac.at>, by hp at vmars.tuwien.ac.at (Peter Holzer):
>
> #pragma speculation_mode on /* :-) */
> There is a rumor among C-programmers that `all struct-pointers smell
> the same.' (I could not find any assertion of this in the standard, and
> I can find pro's and con's for such a rule, so I call it a rumor,
> undoubtedly someone who knows will tell me if it is correct or not)
Consider the following legal and complete C module:
sub()
{
struct s
{
struct t *p;
}s1;
s1.p = (struct t *)&s1;
}
The compiler has to generate a 'struct t' pointer, with no idea of
'struct t's defintion.
----------------------------------------------------------------------------
mikes at rtech.com = Mike Schilling, ASK Corporation, Alameda, CA
Just machines that make big decisions,
Programmed by fellows with compassion and vision. -- Donald Fagen, "IGY"
More information about the Comp.lang.c
mailing list