|
|
Subscribe / Log in / New account

Undefined behaviour

Undefined behaviour

Posted Sep 4, 2018 21:17 UTC (Tue) by rweikusat2 (subscriber, #117920)
In reply to: Undefined behaviour by farnz
Parent article: C considered dangerous

> "Nasal demon" is just a short-cut to saying that "the behaviour of a program is not defined by the standards you are relying upon to > define the progam's meaning, and thus anything could go".

As I already wrote: "It is unknown, hence ..." is logically invalid.


to post comments

Undefined behaviour

Posted Sep 5, 2018 8:45 UTC (Wed) by farnz (subscriber, #17727) [Link] (1 responses)

Exactly, but that sort of reasoning about a standard is common - e.g. "The POSIX standard says that int must be at least 32 bits in size, therefore I can assume that long is 64 bits in size". The point of "nasal demons" is that it is equally correct to say "The POSIX standard says that int must be at least 32 bits in siz, therefore assuming long is 64 bits in size will make demons fly out of your nose" - both are logically invalid statements, but while the first sounds plausible, the second does not.

In other words, it's a way of pointing out that your conclusion does not follow from your antecedents in a comical fashion, and thus that you need to go back and fill in your chain of reasoning.

Undefined behaviour

Posted Sep 6, 2018 10:17 UTC (Thu) by Wol (subscriber, #4433) [Link]

In other words, the well-known proof "reductio ad absurdam".

Cheers,
Wol


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds