This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Compiling GCC With a C++ Compiler (g++)
- From: "Dave Korn" <dk at artimi dot com>
- To: "'Joseph S. Myers'" <jsm at polyomino dot org dot uk>
- Cc: "'Andreas Schwab'" <schwab at suse dot de>,"'Gabriel Dos Reis'" <gdr at cs dot tamu dot edu>,"'Phil Edwards'" <phil at codesourcery dot com>,"'Zack Weinberg'" <zack at codesourcery dot com>,"'Geoffrey Keating'" <geoffk at apple dot com>,"'Ranjit Mathew'" <rmathew at gmail dot com>,<gcc at gcc dot gnu dot org>
- Date: Wed, 13 Oct 2004 16:23:37 +0100
- Subject: RE: Compiling GCC With a C++ Compiler (g++)
> -----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....