r/cpp • • Oct 22 '26

Revisit Safe C++

Everyone is aware of the deluge of vulnerabilities now hitting critical software. It even makes the mainstream news, so software safety is coming onto politician's radars.

If this gets worse, I think it is not inconceivable that at some point memory safe software becomes mandatory. Or at least for software that is "reachable" from the internet.

So is it time to revisit Sean Baxter's Safe C++? Start out with a safe context ("safeexpr") and expand from there, just like constexpr.

36 Upvotes

181 comments sorted by

View all comments

Show parent comment

-1

u/arthurno1 29d ago

nobody was talking about "removing all bounds checks" or anything like that) and also totally misses the point of what I was saying, which was that you can have parts of your program that are statically proven correct under the premise of having a bound --- and then other parts that dynamically establish that this premise actually holds before entering that codepath.

So you are in agreement with me the: if you want perfectly safe program, you can't remove bounds checking always.

it is baffling that people can't pay 5 seconds of mental gymnastics to read and reflect over what is written.

Yes, it is. So go away now, because you seem to accuse me for talking against type checking or whatever, which I certainly don't.