Re: 'C' Operators precedence

H. Peter Anvin (hpa@transmeta.com)
20 May 1998 06:37:11 GMT


Followup to: <19980519231814.17554@molehill.org>
By author: Todd Larason <jtl@molehill.org>
In newsgroup: linux.dev.kernel
>
> > (a=0)+a+(a=1) could evaluate in any of a number of ways, and leave a equal
> > to 0 or 1 afterwards.
>
> Or anything else. Or ignore a completely and go wash your dog. This
> modifies 'a' more than once between sequence points, and is completely
> undefined behavior. (on the quality-of-implementation issue, it would be
> nice if there were some high quality compilers that WOULD go wash your dog
> in this case.)
>

There is an unconfirmed story that a certain version of gcc, if you
invoked some particular kind of undefined behaviour that RMS didn't
approve of (#pragma, I believe), gcc would look for and exec a copy of
nethack.

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

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