Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #380053

Re: Which tools are available for catching UB?

From Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups comp.lang.c
Subject Re: Which tools are available for catching UB?
Date 2024-01-11 16:09 -0800
Organization None to speak of
Message-ID <87sf33mmy3.fsf@nosuchdomain.example.com> (permalink)
References <YXJnN.184010$xHn7.45772@fx14.iad> <unonqf$307b8$1@dont-email.me> <hE_nN.29642$Sf59.27167@fx48.iad>

Show all headers | View raw


Anthony Cuozzo <anthony@cuozzo.us> writes:
[...]
> I suppose I was/am looking for static analysis tools which focus on
> UB, but now that I've given it more thought I realize that only a
> subset of UB can be detected at compile time.

Which, in many or most cases, is exactly why it's UB.

Ideally, something's behavior is left undefined because it's impractical
to detect the problem.  In some cases, behavior has been left undefined
(or unspecified, or implementation-defined) because existing
implementations behave differently.

> Semi-related: Do you know if there's a resource which breaks down UB
> per standard? I'd like to see how things have changed over time.

Each edition of the standard has an annex (Annex J in the case of C11)
that summarizes unspecified, undefined, and implementation-defined
behaviors.  The standards themselves cost money, but drafts are freely
available.

Some instances of undefined behavior are specified explicitly.  Others
are undefined just because the standard provides no definition.  Both
kinds are equivalent, and can in principle result in the same kinds of
Bad Things Happening.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Which tools are available for catching UB? Anthony Cuozzo <anthony@cuozzo.us> - 2024-01-10 23:15 -0500
  Re: Which tools are available for catching UB? David Brown <david.brown@hesbynett.no> - 2024-01-11 13:43 +0100
    Re: Which tools are available for catching UB? Anthony Cuozzo <anthony@cuozzo.us> - 2024-01-11 18:15 -0500
      Re: Which tools are available for catching UB? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-01-11 16:09 -0800
        Re: Which tools are available for catching UB? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-01-14 09:44 -0800
      Re: Which tools are available for catching UB? David Brown <david.brown@hesbynett.no> - 2024-01-12 14:50 +0100
  Re: Which tools are available for catching UB? Richard Kettlewell <invalid@invalid.invalid> - 2024-01-12 08:51 +0000
  Re: Which tools are available for catching UB? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-01-18 18:17 +0000
  Re: Which tools are available for catching UB? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-01-18 19:08 +0000
    Re: Which tools are available for catching UB? James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-01-18 14:42 -0500
      Re: Which tools are available for catching UB? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-01-18 20:24 +0000
    Re: Which tools are available for catching UB? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-01-25 19:57 -0800
      Re: Which tools are available for catching UB? Kaz Kylheku <433-929-6894@kylheku.com> - 2024-01-26 04:52 +0000
        Re: Which tools are available for catching UB? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-02-10 02:06 -0800
  Re: Which tools are available for catching UB? Kaz Kylheku <433-929-6894@kylheku.com> - 2024-01-18 19:41 +0000
    Re: Which tools are available for catching UB? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-01-18 13:18 -0800
    Re: Which tools are available for catching UB? gazelle@shell.xmission.com (Kenny McCormack) - 2024-01-19 03:08 +0000

csiph-web