1 августа 2007 г.

Программистские приколы

Наткнулся на цитату, говорят, из книги "Deep C Secrets". Гуглить первоисточник лень, но история понравилась.
When the ANSI C standard was under development, the pragma directive was introduced. Borrowed from Ada, #pragma is used to convey hints to the compiler, such as the desire to expand a particular function as in-line or suppress some range checks. #pragma met with some initial resistancee from a gcc implementor, who took the "implementation-defined" effect very literally. In gcc version 1.34, the use of pragma caused the compiler to stop compiling and launch a computer game instead. The gcc version 1.34 manual said: "The #pragma command is specified in the ANSI standard to have an arbitrary implementation-defined effect. In GNU C preprocessor, #pragma first attempts to run the game "rogue"; if that fails, it tries to run the game "hack"; if that fails, it tries to run GNU Emacs displaying Tower Of Hanoi; if that fails, it reports a fatal error. In any case, preprocessing does not continue."