Sujet : Or it could be that... (Was: So You Think You Can Const?)
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.lang.cDate : 08. Jan 2025, 22:32:00
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <vlmqsg$2o3e8$1@news.xmission.com>
References : 1 2 3
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
87tta9qauc.fsf@nosuchdomain.example.com>,
Keith Thompson <Keith.S.Thompson+
u@gmail.com> wrote:
...
The author of the article likely thought of "undefined behavior" as
"the program crashes" or "something goes terribly wrong". In fact
undefined behavior is simply behavior that is not defined; the C
standard says nothing about what happens.
>
And if the manifestation of that undefined behavior is that the
code quietly does what you thought it would do, it could mean that
you have a latent bug that's difficult to track down, and that will
come back and bite you later.
Or it could mean that you are covered by some higher, more powerful
standard, such as POSIX. Note that a lot of perfectly good,
POSIX-compliant code is UB if you take the view that the C standard is your
only coverage.
Similarly, lots of perfectly good Linux code is UB if viewed through the
lens of the POSIX standards. My point is that it is perfectly fine to rely
on higher/better standards, provided, of course, that you correctly label
your product (make it clear that you are covered by policies in addition to
and superior to the ordinary C standards).
-- The randomly chosen signature file that would have appeared here is more than 4lines long. As such, it violates one or more Usenet RFCs. In order to remainin compliance with said RFCs, the actual sig can be found at the following URL: http://user.xmission.com/~gazelle/Sigs/BestCLCPostEver