Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #150636
| From | Keith Thompson <Keith.S.Thompson+u@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: "How one word broke C" |
| Date | 2020-03-17 13:39 -0700 |
| Organization | None to speak of |
| Message-ID | <87pndara00.fsf@nosuchdomain.example.com> (permalink) |
| References | <r4r8ev$8ba$1@dont-email.me> |
Lynn McGuire <lynnmcguire5@gmail.com> writes:
> "How one word broke C"
> https://news.quelsolaar.com/2020/03/16/how-one-word-broke-c/
>
> "A lot have been written about the dangers of “Undefined behavior” in
> C. Its an often cited reason why C is a “Dangerous” language that
> invites hard to find bugs, and security issues. In my opinion
> Undefined behavior is not inherently bad. C is meant to be
> implementable on lots of different platforms and, to require all of
> them to behave in the exact same way would be impractical, it would
> limit hardware development and make C less future proof. Some of the
> concerns around undefined behavior in C are based on the fact that C
> is a small enough language that all corners of the language are
> explored and actually matter."
I saw that article via Hacker News
<https://news.ycombinator.com/item?id=22589657>.
I'll copy the comment I posted there (with a typo corrected):
The author claims that:
> In C89, undefined behavior is interpreted as, “The C standard
> doesn’t have requirements for the behavior, so you must define
> what the behavior is in your implementation, and there are a few
> permissible options”.
That's a serious misinterpretation. C89 says that "Permissible
undefined behavior" includes "ignoring the situation completely with
unpredictable results". There is absolutely no requirement to
document what those "unpredictable results" might be.
The standard joke is that one possible consequence of undefined
behavior is making demons fly out of your nose -- not because that's
actually possible, but because actually making demons fly out of
your nose would not violate the standard. That's equally true in C89
and all later versions of C. The change in C99 from "Permissible" to
"Possible" made no difference. The phrase "imposes no requirements"
has always meant exactly that. (And if you think the change from
"Permissible" to "Possible" is semantically significant, then it
would have been a recognition of what was already accepted.)
The idea of "nasal demons" goes back to
1992. http://catb.org/jargon/html/N/nasal-demons.html
There are certainly arguments to be made about how C defines and treats
"undefined behavior", but the author's claim that C99's change from
"Permissible" to "Possible" made a significant difference is incorrect.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips Healthcare
void Void(void) { Void(); } /* The recursive call of the void */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
"How one word broke C" Lynn McGuire <lynnmcguire5@gmail.com> - 2020-03-17 14:29 -0500
Re: "How one word broke C" Real Troll <Real.Troll@Trolls.com> - 2020-03-17 15:40 -0400
Re: "How one word broke C" John Bode <jfbode1029@gmail.com> - 2020-03-19 11:57 -0700
Re: "How one word broke C" James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-03-19 18:20 -0400
Re: "How one word broke C" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-03-17 13:39 -0700
Re: "How one word broke C" Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-03-17 21:55 +0000
Re: "How one word broke C" felix@palmen-it.de (Felix Palmen) - 2020-03-17 23:02 +0100
Re: "How one word broke C" Richard Damon <Richard@Damon-Family.org> - 2020-03-17 21:57 -0400
Re: "How one word broke C" Dan Purgert <dan@djph.net> - 2020-03-18 11:02 +0000
Re: "How one word broke C" Richard Damon <Richard@Damon-Family.org> - 2020-03-18 08:58 -0400
Re: "How one word broke C" Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-03-18 06:04 -0700
Re: "How one word broke C" Richard Damon <Richard@Damon-Family.org> - 2020-03-18 09:53 -0400
Re: "How one word broke C" felix@palmen-it.de (Felix Palmen) - 2020-03-18 14:46 +0100
Re: "How one word broke C" Richard Damon <Richard@Damon-Family.org> - 2020-03-19 08:55 -0400
Re: "How one word broke C" Philipp Klaus Krause <pkk@spth.de> - 2020-03-18 18:21 +0100
Re: "How one word broke C" already5chosen@yahoo.com - 2020-03-18 12:11 -0700
Re: "How one word broke C" Philipp Klaus Krause <pkk@spth.de> - 2020-03-18 21:06 +0100
Re: "How one word broke C" Richard Damon <Richard@Damon-Family.org> - 2020-03-18 22:43 -0400
Re: "How one word broke C" Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-03-27 07:18 -0700
Re: "How one word broke C" Dan Purgert <dan@djph.net> - 2020-03-19 01:40 +0000
Re: "How one word broke C" Eli the Bearded <*@eli.users.panix.com> - 2020-03-18 19:12 +0000
Re: "How one word broke C" Philipp Klaus Krause <pkk@spth.de> - 2020-03-18 21:09 +0100
Re: "How one word broke C" David Brown <david.brown@hesbynett.no> - 2020-03-18 21:35 +0100
Re: "How one word broke C" felix@palmen-it.de (Felix Palmen) - 2020-03-18 23:27 +0100
Re: "How one word broke C" Richard Damon <Richard@Damon-Family.org> - 2020-03-19 08:57 -0400
Re: "How one word broke C" felix@palmen-it.de (Felix Palmen) - 2020-03-19 15:00 +0100
Re: "How one word broke C" David Brown <david.brown@hesbynett.no> - 2020-03-19 15:02 +0100
Re: "How one word broke C" felix@palmen-it.de (Felix Palmen) - 2020-03-19 15:10 +0100
Re: "How one word broke C" gazelle@shell.xmission.com (Kenny McCormack) - 2020-03-19 14:34 +0000
Re: "How one word broke C" Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-03-19 07:44 -0700
Re: "How one word broke C" Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-03-19 14:57 +0000
Re: "How one word broke C" felix@palmen-it.de (Felix Palmen) - 2020-03-19 15:58 +0100
Re: "How one word broke C" David Brown <david.brown@hesbynett.no> - 2020-03-19 16:26 +0100
Re: "How one word broke C" David Brown <david.brown@hesbynett.no> - 2020-03-19 16:08 +0100
Troll, gadfly, whatever... (Was: "How one word broke C") gazelle@shell.xmission.com (Kenny McCormack) - 2020-03-21 11:08 +0000
Re: Troll, gadfly, whatever... (Was: "How one word broke C") Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-03-21 04:50 -0700
Re: "How one word broke C" David Brown <david.brown@hesbynett.no> - 2020-03-19 16:04 +0100
Re: "How one word broke C" felix@palmen-it.de (Felix Palmen) - 2020-03-19 16:16 +0100
Re: "How one word broke C" Richard Damon <Richard@Damon-Family.org> - 2020-03-19 23:36 -0400
Re: "How one word broke C" James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-03-19 18:13 -0400
Re: "How one word broke C" Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2020-03-17 19:43 -0600
Re: "How one word broke C" John Bode <jfbode1029@gmail.com> - 2020-03-24 16:07 -0700
Re: "How one word broke C" James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-03-24 19:41 -0400
csiph-web