This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Enforcing order of execution for function arguments
- From: "Chris Jefferson" <chris at bubblescope dot net>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 10 Jan 2007 15:05:21 +0000
- Subject: Enforcing order of execution for function arguments
Apologises for the slightly off-topic message.
One thing which comes up regularly in various C and C++ messageboards
is that statements like "f() + g()" and "a(f(), g())" do not declare
which order f() and g() will be executed in.
How hard would it be to fix the order of execution in gcc/g++? Could
someone point me to the piece of code which must change, or if it is
only a very small change, the actual change required? I would very
much like to be able to benchmark this, as I can find no previous case
where someone has tried fixing the order of execution to see if it
actually makes any measureable difference.
Would anyone be interested in this being added as a command line argument?
Thank you,
Chris