public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/18050] -Wsequence-point reports false positives
Date: Wed, 22 Mar 2006 12:53:00 -0000	[thread overview]
Message-ID: <20060322125330.10417.qmail@sourceware.org> (raw)
In-Reply-To: <bug-18050-4370@http.gcc.gnu.org/bugzilla/>



------- Comment #8 from rguenth at gcc dot gnu dot org  2006-03-22 12:53 -------
Sure - but this doesn't matter in this case.  And

6.5.3.1 tells you

 "The expression ++E is equivalent to (E+=1)."

6.5.16 says

 "The side effect of updating the stored value of the left operand shall
  occur between the previous and the next sequence point."

For i = ++i; this means we have

 i = (i += 1);

where for i += 1 the next sequence point is the i = ... assigment?

Of course for the particular testcase the ordering of the two stores
does not matter.  Would int i=0; i = ++i + 1; be able to result in
i == 1?  I don't think so as per 6.5.16.


-- 


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


  parent reply	other threads:[~2006-03-22 12:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-18050-4370@http.gcc.gnu.org/bugzilla/>
2006-03-22 12:19 ` rguenth at gcc dot gnu dot org
2006-03-22 12:26 ` joseph at codesourcery dot com
2006-03-22 12:53 ` rguenth at gcc dot gnu dot org [this message]
2006-03-22 13:08 ` schwab at suse dot de
2008-08-27 19:46 ` pinskia at gcc dot gnu dot org
2008-08-28  1:20 ` manu at gcc dot gnu dot org
2008-08-28  1:23 ` pinskia at gcc dot gnu dot org
2008-08-28  1:31 ` manu at gcc dot gnu dot org
2008-08-29  0:09 ` manu at gcc dot gnu dot org
2008-08-29  0:10 ` manu at gcc dot gnu dot org
2004-10-18 21:57 [Bug c/18050] New: " mitr at volny dot cz
2004-10-18 22:01 ` [Bug c/18050] " pinskia at gcc dot gnu dot org
2004-10-18 22:15 ` giovannibajo at libero dot it
2004-10-18 22:25 ` pinskia at gcc dot gnu dot org
2004-10-18 22:35 ` pinskia at gcc dot gnu dot org
2004-10-18 22:45 ` 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=20060322125330.10417.qmail@sourceware.org \
    --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).