public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: kaih@khms.westfalen.de (Kai Henningsen)
To: gcc@gcc.gnu.org
Subject: Re: Compiling GCC With a C++ Compiler (g++)
Date: Fri, 15 Oct 2004 12:48:00 -0000	[thread overview]
Message-ID: <9Ivae5Amw-B@khms.westfalen.de> (raw)
In-Reply-To: <jeis9dqn79.fsf@sykes.suse.de>

schwab@suse.de (Andreas Schwab)  wrote on 14.10.04 in <jeis9dqn79.fsf@sykes.suse.de>:

> Gabriel Dos Reis <gdr@cs.tamu.edu> writes:
>
> > If you're making the assumption that nonmodifiability necessarily
> > implies that the whole thing is const-qualified, then you're wrong and
> > I'm not surprised you're not satisfied with what the standard says.
>
> You mean that the following (which does not contain any casts) is invoking
> undefined behaviour?
>
> struct A { int a; const int b; } X;
>
> void f (int *x) { *x = 1; }
>
> int main (void) { f (&X.a); return 0; }

Try this instead, which doesn't even use pointers:

struct A { int a; const int b; };

struct A a1;
struct A a2 = { 1, 2 };

...

a1.a = a2.a; // legal
a1.b = a2.b; // illegal

a1 = a2; // illegal


MfG Kai

  reply	other threads:[~2004-10-15  7:23 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-11  9:53 Ranjit Mathew
2004-10-12 10:06 ` Ranjit Mathew
2004-10-12 13:17   ` Gabriel Dos Reis
2004-10-12 21:15   ` Geoffrey Keating
2004-10-12 23:00     ` Gabriel Dos Reis
2004-10-12 23:23       ` Zack Weinberg
2004-10-13  2:53         ` Phil Edwards
2004-10-13  6:24           ` Gabriel Dos Reis
2004-10-13 10:57             ` Andreas Schwab
2004-10-13 13:16               ` Gabriel Dos Reis
2004-10-13 13:56                 ` Andreas Schwab
2004-10-13 14:22                   ` Gabriel Dos Reis
2004-10-13 15:06                     ` Andreas Schwab
2004-10-13 15:22                       ` Gabriel Dos Reis
2004-10-13 15:33                         ` Andreas Schwab
2004-10-13 18:20                           ` Gabriel Dos Reis
2004-10-13 19:09                             ` Andreas Schwab
2004-10-13 11:47             ` Dave Korn
2004-10-13 12:24               ` Andreas Schwab
2004-10-13 13:29                 ` Gabriel Dos Reis
2004-10-13 14:10                   ` Andreas Schwab
2004-10-13 14:30                     ` Dave Korn
2004-10-13 14:50                       ` Dave Korn
2004-10-13 18:25                         ` Andreas Schwab
2004-10-13 15:04                       ` Joseph S. Myers
2004-10-13 17:01                         ` Dave Korn
2004-10-13 21:16                           ` Geoffrey Keating
2004-10-14 13:26                             ` Dave Korn
2004-10-14 13:32                               ` Gabriel Dos Reis
2004-10-14 18:40                                 ` Andreas Schwab
2004-10-14 18:48                                   ` Gabriel Dos Reis
2004-10-14 20:33                                 ` Geoffrey Keating
2004-10-14 20:19                               ` Geoffrey Keating
2004-10-15 12:03                               ` Kai Henningsen
2004-10-13 14:53                     ` Gabriel Dos Reis
2004-10-13 15:46                     ` Gabriel Dos Reis
2004-10-13 19:41                 ` Matt Austern
2004-10-13 20:29                   ` Andreas Schwab
2004-10-13 20:41                     ` Matt Austern
2004-10-13 20:58             ` Phil Edwards
2004-10-13  9:23           ` Ranjit Mathew
2004-10-13 13:09             ` Ranjit Mathew
2004-10-13 19:13               ` Richard Henderson
2004-10-13 21:55                 ` Gabriel Dos Reis
2004-10-13 13:29             ` Gabriel Dos Reis
2004-10-13  5:49         ` Gabriel Dos Reis
2004-10-13  9:19           ` Zack Weinberg
2004-10-13 13:45             ` Gabriel Dos Reis
2004-10-13 20:39           ` Geoffrey Keating
2004-10-13 21:45             ` Gabriel Dos Reis
2004-10-13 22:15               ` Geoffrey Keating
2004-10-13 22:24                 ` Gabriel Dos Reis
2004-10-13 22:53                   ` Joseph S. Myers
2004-10-13 23:19                   ` Geoffrey Keating
2004-10-14  0:21                     ` Gabriel Dos Reis
2004-10-14  6:04                       ` Andreas Schwab
2004-10-14  7:10                         ` Gabriel Dos Reis
2004-10-14 11:29                           ` Andreas Schwab
2004-10-14 13:06                             ` Gabriel Dos Reis
2004-10-14 18:37                               ` Andreas Schwab
2004-10-15 12:48                                 ` Kai Henningsen [this message]
2004-10-13  3:47 Steven L. Zook
2004-10-13  7:26 ` Gabriel Dos Reis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9Ivae5Amw-B@khms.westfalen.de \
    --to=kaih@khms.westfalen.de \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).