From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29753 invoked by alias); 22 Mar 2006 12:26:16 -0000 Received: (qmail 29733 invoked by alias); 22 Mar 2006 12:26:13 -0000 Date: Wed, 22 Mar 2006 12:26:00 -0000 Message-ID: <20060322122613.29732.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: "joseph at codesourcery dot com" 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/msg02197.txt.bz2 List-Id: ------- Comment #7 from joseph at codesourcery dot com 2006-03-22 12:26 ------- Subject: Re: -Wsequence-point reports false positives On Wed, 22 Mar 2006, rguenth at gcc dot gnu dot org wrote: > i = ++i; Modified twice between sequence points, so undefined behavior. > 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: It's undefined behavior, not undefined evaluation order. Pre-increment returns the new value, but that doesn't mean the new value is stored until the following sequence point. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18050