public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "msimons at simons-clan dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/11633] g++ does not initialize structures when auto-increment variables are used
Date: Tue, 22 Jul 2003 23:19:00 -0000	[thread overview]
Message-ID: <20030722231958.9879.qmail@sources.redhat.com> (raw)
In-Reply-To: <20030722205341.11633.msimons@simons-clan.com>

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11633



------- Additional Comments From msimons at simons-clan dot com  2003-07-22 23:19 -------
  A friend pointed out language in the gcc.info file which appears to cover
the 'comma' ordering case:
===
   * Making side effects happen in the same order as in some other
     compiler.

     It is never safe to depend on the order of evaluation of side
     effects.  For example, a function call like this may very well
     behave differently from one compiler to another:

          void func (int, int);
          
          int i = 2;
          func (i++, i++);

     There is no guarantee (in either the C or the C++ standard language
     definitions) that the increments will be evaluated in any
     particular order.  Either increment might happen first.  `func'
     might get the arguments `2, 3', or it might get `3, 2', or even
     `2, 2'.
===

  I'm not sure if this applies here... and if it *does* apply it seems
inconsistant that things like: ++foo-1, ++foo-1 ... foo++ + 0, foo++ + 0 ...
and value(), value()... all get evaluated left to right, but foo++, foo++ value
gets looked up once, and gets somehow the increment happens N times.

  I am very interested in what the c++ language lawyers have to say about this 
sample.  If it is truely undefined I am *amazed* that practically all of the
remaining commercial unix, c++ compilers do it the same way.


  parent reply	other threads:[~2003-07-22 23:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-22 20:53 [Bug c++/11633] New: " msimons at simons-clan dot com
2003-07-22 20:55 ` [Bug c++/11633] " msimons at simons-clan dot com
2003-07-22 21:41 ` bangerth at dealii dot org
2003-07-22 21:55 ` bangerth at dealii dot org
2003-07-22 22:10 ` msimons at simons-clan dot com
2003-07-22 23:19 ` msimons at simons-clan dot com [this message]
2003-07-22 23:36 ` bangerth at dealii dot org
2003-07-23  1:09 ` msimons at simons-clan dot com
2003-07-23  9:04 ` nathan at gcc dot gnu dot org
2003-08-23 17:11 ` pinskia at gcc dot gnu dot org
2003-11-21 16:55 ` pinskia at gcc dot gnu dot org
2003-11-21 16:57 ` pinskia at gcc dot gnu dot org
2004-04-30  1:47 ` [Bug c++/11633] [DR 430] " pinskia at gcc dot gnu dot org
2004-04-30 18:17 ` pinskia at gcc dot gnu dot org

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=20030722231958.9879.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).