Re: 'C' Operators precedence

Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Wed, 20 May 1998 19:51:35 +0100 (BST)


On Wed, 20 May 1998, Richard B. Johnson wrote:

> > And this _without_ optimisation. gcc is right to do this; if a function
> > clobbers registers, then let it do so when the variables don't contain
> > anything interersting anyway.
> >
> > Your point was..?
>
> Sigh. It has nothing to do with clobbering registers. It has to do with
[snip]
> printf("%d\n", f() + b + c + d + e );
> printf("%d\n", b + f() + c + d + e );
> printf("%d\n", b + c + f() + d + e );
> printf("%d\n", b + c + d + e + f() );
> return 0;
[snip]
> This will show that the function is always called first, regardless
> of where it is first seen by the compiler. It must do this because
> of the reasons previously stated.

By this reasoning, if I'm not much mistaken, it's not actually _possible_
to compile "f()+f()"...?

Matthew.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu