Wednesday, December 06 2006: demons fly out your nose
I found the odetocode blog after idly googling demon fly out nose:
As the author of the original "demons may fly out of your nose", I'd like to point out that the real point of the "undefined behavior" discussions was not to assert that bizarre behavior must necessarily result from incorrect or undefined code; it was to defeat the frequently seen argument that "compiler X is junk because it doesn't generate correct code for my program", where "my program" inevitably included an instance of undefined behavior (dereferencing NULL, sizeof(struct undefined), or whatever). Merely replying "the standard says you shouldn't" never convinces these people; they always come back with "well, compilers Y and Z do what I expect, so obviously I'm right", followed closely by "how can the standard possibly permit a compiler to output broken code even if a construct isn't officially defined?" Thus there was an ever escalating insistence that "undefined" does not mean "whatever the user thinks would make his broken program work", it means "undefined by the standard and beyond the pale of the language". Compilers aren't obligated to mistreat programmers who step outside the language definition, but they certainly aren't obligated to treat them kindly, and a compiler which "works" one release with an incorrect construct may not "work" the next release -- even though the compiler is, in fact, perfectly conforming in both cases. (Although there have been some programmers who I *wished* had compilers which formatted their hard drives when undefined language constructs were used...) (I just idly decided to go googling for "nose demons compiler" to see how many references to the idea were still floating around.)