3 ms·
We actually (almost) have that. It is called gcc. A long time ago, when encountering "undefined" behavior, it would try to launch Nethack[1]. (It is valid beha
by __jal 11y ago
We actually (almost) have that. It is called gcc.
A long time ago, when encountering "undefined" behavior, it would try to launch Nethack[1]. (It is valid behaviour, according to the spec.)
Seriously, ask around. There was a multi-month fat-chewing about gcc's pathological interpretation of "undefined" earlier this year on the Cryptography list, and tends to come up anywhere C programmers with an interest in security drink.
[1] http://feross.org/gcc-ownage/?1?1 http://feross.org/gcc-ownage/?1?1
- _kst_ 11y agoThat's inaccurate, according to the page you linked to (and to my memory of the incident). gcc 1.17 would invoke nethack (or one of several other similar games, if available) if it saw an unrecogized #pragma directive. According to the C standard, the behavior of a #pragma not followed by STDC is implementation-defined, not undefined -- which means that an implementation is required to document its behavior. (I presume that gcc did so.) gcc did not play launch Nethack in response to undefined behavior in general, or in response to anything other than an unrecognized #pragma directive.