[comp.lang.c] Old-fashioned assignment operators

guy@auspex.UUCP (Guy Harris) (12/18/88)

(Wow, a C question in comp.unix.*, rather than the other way around!)

>  The question I have is, what exactly *is* the correct interpretation of
>x=-y in modern C?

In sufficiently modern C, the interpretation is "assign the negative of
the value of 'y' to 'x'".

>What does the ANSI C standard say about this?

The dpANS says "=-" should not be interpreted as an assignment operator
(and the final standard, once it exists, will almost certainly say the
same thing).  The (non-dpANS-conformant) C compilers AT&T has
distributed with System V releases do not interpret it as such, and
more C compilers are picking this up (for instance, in SunOS 4.0,
support for "old-style assignment operators" went away).