• Or it could be that... (Was: So You Think You Can Const?)

    From Kenny McCormack@21:1/5 to Keith.S.Thompson+u@gmail.com on Wed Jan 8 21:32:00 2025
    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 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/BestCLCPostEver

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)