public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mmitchell@usa.net>
To: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Cc: law@cygnus.com, egcs@cygnus.com
Subject: Re: libio bugs
Date: Mon, 02 Feb 1998 11:43:00 -0000	[thread overview]
Message-ID: <199802020725.HAA28844@quickstep.stanford.edu> (raw)
In-Reply-To: <vyzvhuyuway.fsf@issan.informatik.uni-dortmund.de>

    Andreas> |> Since the order of initializers isn't supposed to
    Andreas> matter, there is |> definitely a bug here if this fix
    Andreas> makes a difference.  Does anyone |> have a simple
    Andreas> test-case for this bug?

    Andreas> G++ simply ignores all initializer labels.  I have
    Andreas> already send a bug report, here it is again:

Ah, I see.  But initializer labels are a g++ extension.  Perhaps it
would be simpler simply to issue an error message on any use of
initializer labels?  Is the point of this to allow out-of-order
initialization of the members?  Why is there code in libio that uses
this extension?  Is there other C++ code that uses this extension?

    Andreas> $ cat init.cc struct X { int a, b; };

    Andreas> struct X f (int a, int b) { struct X y = { b: b, a: a };
    Andreas> // labels ignored by g++ return y; }

    Andreas> int main () { struct X x = f (42, 0); if (x.a != 42 ||
    Andreas> x.b != 0) abort (); exit (0); } $ gcc init.cc $ ./a.out
    Andreas> Aborted (core dumped)

    Andreas> -- Andreas Schwab "And now for something
    Andreas> schwab@issan.informatik.uni-dortmund.de completely
    Andreas> different" schwab@gnu.org


-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu


  reply	other threads:[~1998-02-02 11:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-01 12:44 Jeffrey A Law
1998-02-01 22:52 ` Mark Mitchell
1998-02-02  2:38   ` Andreas Schwab
1998-02-02 11:43     ` Mark Mitchell [this message]
1998-02-04  2:16       ` Andreas Schwab
1998-02-10 14:45         ` Mark Mitchell
1998-02-11  4:23           ` Andreas Schwab
1998-02-11 11:23             ` Mark Mitchell
  -- strict thread matches above, loose matches on Subject: below --
1998-01-21  9:54 Andreas Schwab
1998-01-23 21:26 ` H.J. Lu

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=199802020725.HAA28844@quickstep.stanford.edu \
    --to=mmitchell@usa.net \
    --cc=egcs@cygnus.com \
    --cc=law@cygnus.com \
    --cc=schwab@issan.informatik.uni-dortmund.de \
    /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).