Top
Best
New

Posted by chmaynard 12/3/2025

Checked-size array parameters in C(lwn.net)
110 points | 60 commentspage 2
halayli 12/4/2025|
on a similar note, there are also these field attributes that are very helpful for catching similar issues:

https://clang.llvm.org/docs/AttributeReference.html#counted-...

1over137 12/4/2025|
Anyone know if there's a flag to tell clang to treat `void fn(int array[N])` as if it was `void fn(int array[static N])`?
int_19h 12/6/2025|
I don't think such a thing exists simply because it would break so many headers if you turned that on, it wouldn't be particularly useful.
1over137 12/6/2025||
Why would it break headers? Who writes fn(array[16]) expecting less that 16 elements?
int_19h 12/11/2025||
They might expect 16 elements if it's not null, but still consider null a valid value, for example.