This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: volatile is not volatile enough
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Hirogen2 <hirogen2 at gmx dot de>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Jun 2003 10:04:32 -0400
- Subject: Re: volatile is not volatile enough
- References: <Pine.LNX.4.53.0306251515330.27252@yvahk01.tjqt.qr>
On Wed, Jun 25, 2003 at 03:20:57PM +0200, Jan Engelhardt wrote:
> Hi,
>
> given a statement like
> int a[2];
> func2(func1(a), a[0], a[1]);
> where a is modified by func1, func2 receives wrong input on the stack. In
> detail, first a[1], then a[0] and then a is pushed onto the stack, then func1
> gets called and pops off its a -- which is modified after.
> Adding the keyword volatile doesnot help.
>
> I am using gcc 3.3 20030226 (prerelease) SuSE Linux 8.2.
This isn't a GCC bug. The order of evaluation of function arguments is
undefined - including nested function calls.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer