[Scummvm-devel] Re: [Scummvm-cvs-logs] SF.net SVN: scummvm: [20970] scummvm/trunk/engines/kyra/sound_adlib.cpp

Max Horn max at quendi.de
Tue Feb 28 01:53:04 CET 2006


On Di, Februar 28, 2006 09:49, eriktorbjorn at users.sourceforge.net wrote:
> Revision: 20970
> Author:   eriktorbjorn
> Date:     2006-02-28 00:49:51 -0800 (Tue, 28 Feb 2006)
> ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20970&view=rev
>
> Log Message:
> -----------
> This may be needless paranoia, but I always get nervous about order of
> evaluation when there are multiple side-effects on the same variable (in
> this
> case the internal state modified by va_arg()) in the same expression. So
> let's
> just humor me and do the va_arg() calls one at a time.
>

It's a very good thing, not just paranoia. And I'd like to encourage
anybody else who wants to write portable software to do the same. While
problems should only occur when the comma operator is involved (including
function calls, where the stack order of the target system can and does
influence the evaluation order), I think it's best to simply always
enforce this as a rule of the thumb :-).


Cheers,
Max




More information about the Scummvm-devel mailing list