H
haroon
Consider this function,
void fun (int i, int j)
{
printf ("i = %d : j = %d", i, j);
}
I call it like this:
fun (n++, n);
this when compiled with gcc 4.0 gives following out put:
i = 9 : j = 10
but on gcc 3.4.3 the out put is:
i = 9 : j = 9
although the order of evaluation for function arguments is unspecified
still shouldn't the compiler be consistent in its different versions?
can any one explain why did they change this in version 4 of gcc?
Rgrds,
haroon
void fun (int i, int j)
{
printf ("i = %d : j = %d", i, j);
}
I call it like this:
fun (n++, n);
this when compiled with gcc 4.0 gives following out put:
i = 9 : j = 10
but on gcc 3.4.3 the out put is:
i = 9 : j = 9
although the order of evaluation for function arguments is unspecified
still shouldn't the compiler be consistent in its different versions?
can any one explain why did they change this in version 4 of gcc?
Rgrds,
haroon