Compiling GCC With a C++ Compiler (g++)
Dave Korn
dk@artimi.com
Wed Oct 13 17:01:00 GMT 2004
> -----Original Message-----
> From: Joseph S. Myers
> Sent: 13 October 2004 15:10
> Without "restrict" the only relevant undefined behavior is if
> the object
> is *defined* with qualified type (6.7.3#5). This can apply
> with static or
> automatic storage duration declarations such as
>
> struct { const char x } y = { z };
>
> but cannot apply to an object of allocated storage duration.
Huh? Are you saying that in:
typedef struct { const char x } AA;
AA *py1, py2;
AA y1 = { z };
py1 = malloc (sizeof *py2);
py2 = &y1;
it is valid to say
*(char *)(&py1->x) = '?';
but not valid to say
*(char *)(&py2->x) = '?';
? I think I may have reached the point at which I am starting to
boggle.....
cheers,
DaveK
--
Can't think of a witty .sigline today....
More information about the Gcc
mailing list