From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26445 invoked by alias); 22 Mar 2006 12:19:44 -0000 Received: (qmail 26433 invoked by uid 48); 22 Mar 2006 12:19:43 -0000 Date: Wed, 22 Mar 2006 12:19:00 -0000 Message-ID: <20060322121943.26432.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/18050] -Wsequence-point reports false positives In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-03/txt/msg02196.txt.bz2 List-Id: ------- Comment #6 from rguenth at gcc dot gnu dot org 2006-03-22 12:19 ------- Another one: int foo(int i) { i = ++i; return i; } I think the point is we should not warn for pre-increment, only post-increment. Or can someone come up with a testcase that has undefined evaluation order just by using pre-increment? One with two pre-increments: int foo(void) { int i = 1; i = (++i == 2) + ++i; return i; } This is certainly undefined. But with one pre-increment only? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18050