News for hackers. Stuff that matters.
Re:OS X app in plain C by userbinator on Thursday May 05, 2016 @11:26PM (#11641478)
So, apparently, one cannot even count on C compilers to push arguments from left to right.

Right-to-left is pretty much the most sensible way to implement variadic functions with a stack-based calling convention - the argument that the function uses to interpret the rest of them must be found at a known location relative to the stack "top", and due to how stacks work, that implies the varying portion has to be pushed first, thus right-to-left.

Maybe if C decided to design things a little differently:

    int printf(..., const char *format);
    ...
    printf(5, "There are %d lights.\n");
we would instead have right-to-left being the dominant C calling convention.

There are no comments on this comment yet.