C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Efficient and silent bounds checking with silent_at()

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 05 Jul 2023 19:08:42 -0700
On Wednesday, 5 July 2023 18:56:37 PDT trtaab trtaab via Std-Proposals wrote:
> silent crash without any output. By utilizing mechanisms such as
> __builtin_trap() in GCC and Clang, the method offers a controlled program
> termination without producing any additional garbage or debug output.

Crashes are NOT silent. However, _exit is silent.

Please change your function's name and provide a generic implementation for a
compiler that doesn't implement __builtin_trap.

Please also provide commentary on how developers would debug such faults, such
as compiling in debug mode, or doing post-mortem debugging, even if the
comment is "this is not debuggable".

> This distinction is particularly important for developers who prioritize
> performance and optimization, as well as those who prefer a minimalistic
> approach without the overhead of exceptions or unwanted output.

Those developers prioritise performance over correctness?

And if those developers have already ascertained that the indexes cannot be
out of bounds, would they need your suggested method at all?


-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-07-06 02:08:44