Date: Sat, 23 May 2026 20:52:36 -0700
>> Ok i see. yes, a diagnostic warning of every trap (SIGTRAP) etc or
abort() call left in an ELF would be useful to see.
That is easy. You can use the *ar* command to make a copy of *libc/libc++* for
use with your optimized builds with *abort* and all other functions deemed
unsafe deleted.
You could also have a tiny library *-ldragons* that added *void
std::here_be_dragons**()* which just calls *abort()* to your unoptimized
build only because the compiler does not strip unused references in that
mode.
Then, if *std::here_be_dragons**()* was linked against in your optimized
build (and without that library) you would get link errors when that
function was still reachable after proper analysis. This works right now.
The machinery is already there. The standard just has to add
*std::here_be_dragons**()* and not standardize when a diagnostic is
required or what library it is in. And then *recommend* a diagnostic is
issued in optimized builds when that function is reachable and also
*suggest* a diagnostic could be issued in unoptimized builds when it is
reachable.
abort() call left in an ELF would be useful to see.
That is easy. You can use the *ar* command to make a copy of *libc/libc++* for
use with your optimized builds with *abort* and all other functions deemed
unsafe deleted.
You could also have a tiny library *-ldragons* that added *void
std::here_be_dragons**()* which just calls *abort()* to your unoptimized
build only because the compiler does not strip unused references in that
mode.
Then, if *std::here_be_dragons**()* was linked against in your optimized
build (and without that library) you would get link errors when that
function was still reachable after proper analysis. This works right now.
The machinery is already there. The standard just has to add
*std::here_be_dragons**()* and not standardize when a diagnostic is
required or what library it is in. And then *recommend* a diagnostic is
issued in optimized builds when that function is reachable and also
*suggest* a diagnostic could be issued in unoptimized builds when it is
reachable.
Received on 2026-05-24 03:52:51
