J
Jan Engelhardt
Hi,
I was told that order of evaluation is unspecified for functions, i.e.
int f = 0;
print_results(modify(&f), modify(&f), modify(&f));
where i.e. modify() increases f by one. In my case w/gcc, it was evaluated from
right-to-left (gcc does a nice stack optimization). Not what I expected though.
Anyway:
Taking a look at the C operator precedence table, I find
, sequential expression left-to-right
at the bottom. So what's wrong here?
I was told that order of evaluation is unspecified for functions, i.e.
int f = 0;
print_results(modify(&f), modify(&f), modify(&f));
where i.e. modify() increases f by one. In my case w/gcc, it was evaluated from
right-to-left (gcc does a nice stack optimization). Not what I expected though.
Anyway:
Taking a look at the C operator precedence table, I find
, sequential expression left-to-right
at the bottom. So what's wrong here?