In C language why it has been the convention that function argument shall be pushed on the stack from "Right to Left" it could have been "Left to Right". Is there any advantage/disadvantage? Obviously the answer to this call will be different.
int a = 1 ;
printf ( "%d %d %d", a, ++a, a++ ) ;
Is there any relation to the variable number of arguments which was needed to be supported, where the first argument was the most important and required to be present right at the top of the stack.
e.g. (argc,argv) OR printf("%...format " , arg1, arg2...)
Is there no relation at all??
Agreed that calling convention has to be bound to the processor architecture. I guess left to right or right to left was not based on process architecture but more from language perspective which I wanted to understand.
Most of the articles just state that it is right to left, no one tells the logic behind that. ( why it was felt to be more convenient)
No. Well, maybe. Variable arguments (as C and C++ implement them) have always been a hack. They do require a caller-cleanup convention.
As for the push order, when given two equally valid, useful choices, which do you make? I am not privvy to more information about it (or I have forgotten). You may need to ask Mr. Ritchie.