NE #28: Nasal Daemons

No, part 28 of the need encyclopaedia has nothing to do with colds, but with strict compilers:

Nicky Reinert
1 min readFeb 3, 2024

In computer science, there is the term “undefined behavior” [WIKI7]: If a software resp. Code on different systems leads to different results, which of course must not occur, if one speaks of this very “undefined behavior”. In the programming language C, the term “ nasal demons” has become established. This statement originated in the Usenet Group comp.std.c and a discussion in 1992. A user said:

“When the compiler encounters [a given undefined construct] it is legal for it to make demons fly out of your nose” [a given undefined construct] it is legal for it to make demons fly out of your nose” [CATB]

Translated, the compiler hits an “ undefined construct ” if he should be allowed to let demons fly out of your nose.

A simple example in C is this [ACCU1]:

bool b;
if (b)
printf(“b is true n”);
if (!b)
printf(“b is false ’n”);

B is declared as a Boolean variable, but not initialized. It is therefore not clear whether B is true or false. The compiler is allowed to do “whatever he wants”. As e.g. Let demons fly out of your nose

Nerd Encyclopedia #28

--

--

Nicky Reinert

generalist with many interests, developer, photograph, author, gamer