YAAO (yet another assignment operator)
David Herron, NPR Lover
david at ukma.UUCP
Tue Jan 1 04:23:02 AEST 1985
> I shudder to suggest this, but if you want that effect, how about:
>
> register float *y;
> ...
> *(y=&a[...]) = func( *y );
>
> David sde at mitre-bedford
Good thing you shudder to suggest that. Won't work with the 4.2 vax
compiler. The 4.2 compiler evaluates any function calls in an expression
BEFORE anything else. This is so the code will work. (Don't remember the
exact reason but recall that it had to do with the saving of r0 and r1
correctly). So (in your code) func will be called with the contents
of whatever random place y points at.....possibly resulting in a hard
to find bug.
Now, if you want it all in one line of code:
y=&a[...], *y = func( *y );
(Ain't C fun?)
David Herron
More information about the Comp.lang.c
mailing list