Live data from Hacker News

-fbounds-safety: Enforcing bounds safety for C

clang.llvm.org

21–30 of 129 posts

Re: -fbounds-safety: Enforcing bounds safety for C

#21
post #8

Earlier quoted context omitted.

and if you write directly in assembly you don't even need a C++ compiler

That's an objectively correct statement, but I don't see how it makes sense as a response to my comment, as I'm advocating to use the more advanced feature-rich tool over the compiler-specific-hacks one.

> I don't see how it makes sense as a response to my comment

Your comment started out with "just."

As if there are never any compelling reasons to want to make existing C code better.

But instead of taking that as an opportunity to reflect on when various tools might be appropriate,

> as I'm advocating to use the more advanced feature-rich tool over the compiler-specific-hacks one.

You've simply doubled down.

Re: -fbounds-safety: Enforcing bounds safety for C

#22
post #2

I want an OS distro where all C code is compiled this way. OpenBSD maybe? or a fork of CheriBSD? macOS clang has supported -fbounds-safety for a while, but I"m not sure how extensively it is used.

What are you hoping it will achieve?

Re: -fbounds-safety: Enforcing bounds safety for C

#24
post #2

I want an OS distro where all C code is compiled this way. OpenBSD maybe? or a fork of CheriBSD? macOS clang has supported -fbounds-safety for a while, but I"m not sure how extensively it is used.

What are you hoping it will achieve?

The internet went down because cloudflare used a bad config... a config parsed by a rust app.

One of these days the witch hunt against C will go away.

Re: -fbounds-safety: Enforcing bounds safety for C

#29
post #26
post #23

this is amazing, counter to what most ppl think, majority of memory bugs are from out of bounds access, not stuff like forgetting to free a pointer or some such

I think UAFs are more common in mature software

Or type confusion bugs, or any other stuff that stems from complex logic having complex bugs.

Boundary checking for array indexing is table stakes.

Re: -fbounds-safety: Enforcing bounds safety for C

#30
Has any progress been made on this? I remember seeing this proposal 3 or 4 years ago but it looks like it still hasn't been implemented. It's a shame because it seems like a useful feature. It looks like Microsoft has something similar (https://learn.microsoft.com/en-us/cpp/code-quality/understan...) but it would be nice to have something that worked on other platforms.
Post reply on HN