This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Weird result for modulus operation
- From: "Andrew Pinski" <pinskia at gmail dot com>
- To: "Ang Way Chuang" <wcang at nav6 dot org>
- Cc: gcc at gcc dot gnu dot org, mysurface at hotmail dot com
- Date: Tue, 29 Apr 2008 20:52:56 -0700
- Subject: Re: Weird result for modulus operation
- References: <4817EC75.2000905@nav6.org>
On Tue, Apr 29, 2008 at 8:50 PM, Ang Way Chuang <wcang@nav6.org> wrote:
> abc.a = abc.a++ % abc.b;
You are assigning to abc.a twice without a sequence point inbetween so
this code is undefined as the order of evaluation of expressions
without a sequence point is unspecified.
Thanks,
Andrew Pinski