C++ Logo

std-discussion

Advanced search

Re: Opt-In Compile Time Bounds Checking

From: Jonny Grant <jg_at_[hidden]>
Date: Sun, 30 Jul 2023 13:57:53 +0100
On 28/07/2023 03:03, Levo DeLellis via Std-Discussion wrote:
> Hi all. Last week I attended the CppNorth conference. I didn't realize there was much interest in safety with C++. I've been implementing a compiler that is slowly becoming memory safe so I thought maybe I should submit a series of proposals since I'm already familiar with potential pitfalls, solutions and implementation.
>
> Here's a basic proposal attached, it's a small step towards memory safety. Here I talk about opt-ing into a container that has bounds checking at compile time. If there's any interest in having this in the standard I'd be happy to write more about this and additional proposals going toward memory safety
>

Levo,

Personally, it sounds interesting, have you published your compiler online?

Safety and avoiding code crashes is vital in automotive and aviation.

Re Ex 3 Have you implemented 'safespan'? Am I correct in thinking your compiler understands the implementation of that container, and would output a warning from static analysis for an 'invalidated' args access that hadn't been just been checked against args.size()? (since any change)

Wouldn't that args[0][0] also need a safety check on the element args[0][N] just in case? in case there was an empty nul terminated string in the array of pointers (ie for another use, instead of relying upon main argv list having all non-empty strings)

Regards, Jonny

Received on 2023-07-30 12:57:56