C++ Logo

liaison

Advanced search

[wg14/wg21 liaison] UB

From: Martin Uecker <ma.uecker_at_[hidden]>
Date: Fri, 19 May 2023 14:42:03 +0200
Hi everybody,

the C UB study group recommends to clarify that run-time
UB affects the concrete operations upon use of the
operation which has UB (concrete interpretation),
but does not make those programs have no semantics at all
(abstract interpretation).

I wrote a paper about this:

https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3128.pdf


The short summary is:

1.) The abtract interpretation that makes programs have
no semantics is not required for existing optimizations.

2.) With the concrete interpretation one can show
partial programm correctness up to the point where
the operation that has UB is encountered.

3.) The concrete interpretation makes it possible to
formulate additional requirements for programs that
have run-time UB (e.g. Annex L in C, or for
concurrent programms as suggested in Hans Boehm's
paper). As such it is a prerequesite to make further
progress in limiting the consequences of UB.


Any thoughts about this? I think C++ could simply
do the same. But I assume there are many different
opinions about this.


Martin

Received on 2023-05-19 12:42:06