[comp.sys.ibm.pc.programmer] post increment

L.Parkes@comp.vuw.ac.nz (Lloyd Parkes) (03/22/90)

Your code was:
> main()
> {
> int a=0;
> int *b= &a;
> printf("%d\n", (*b) + (a++) );
> }

I was always under the impression that while C defined operator
precedence, and operator associativity, it didn't define order of
evaluation for arithmetic. Hence GCC is simply evaluating the left
hand side first, which is completely legal. I don't write code like
that because I never know how it will turn out.

					Lloyd
Disclaimer: Well, I could be wrong.
--
------------------------------------------------------------------------
Lloyd	| lloyd@comp.vuw.ac.nz	  | "... I can gleek upon occasion." - 
Parkes	| ...!uunet!vuwcomp!lloyd | Nick Bottom
------------------------------------------------------------------------