Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It depends on the argument type, the called function's calling convention, the archtecture and the compiler. On an x86, the <a href="http://en.wikipedia.org/wiki/X86_calling_conventions#pascal" rel="noreferrer">Pascal</a> calling convention evaluates arguments left to right whereas in the C calling convention (<a href="http://msdn.microsoft.com/en-us/library/zkwh89ks(VS.80).aspx" rel="noreferrer">__cdecl</a>) it is right to left. Most programs which run on multiple platforms do take into account the calling conventions to skip surprises. </p> <p>There is a nice <a href="http://blogs.msdn.com/oldnewthing/archive/2004/01/08/48616.aspx" rel="noreferrer">article</a> on Raymond Chen' blog if you are interested. You may also want to take a look at the <a href="http://gcc.gnu.org/onlinedocs/gccint/Stack-and-Calling.html" rel="noreferrer">Stack and Calling</a> section of the GCC manual.</p> <p><strong>Edit:</strong> So long as we are splitting hairs: My answer treats this not as a language question but as a platform one. The language standard does not gurantee or prefer one over the other and leaves it as <strong>unspecified</strong>. Note the wording. It does not say this is undefined. Unspecified in this sense means something you cannot count on, non-portable behavior. I don't have the C spec/draft handy but it should be similar to that from my n2798 draft (C++) </p> <blockquote> <p>Certain other aspects and operations of the abstract machine are described in this International Standard as unspecified (for example, order of evaluation of arguments to a function). Where possible, this International Standard defines a set of allowable behaviors. These define the nondeterministic aspects of the abstract machine. An instance of the abstract machine can thus have more than one possible execution sequence for a given program and a given input.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload