News for hackers. Stuff that matters.
Re:How to use the new counted_by attribute in C (and Linux) by db48x on Saturday July 20, 2024 @03:42PM (#41019163)
It’s just as easy to make that mistake, but at least then the compiler can issue a warning.
Re:How to use the new counted_by attribute in C (and Linux) by akira2501 on Saturday July 20, 2024 @05:39PM (#41020201)
It's better than that. If you use FORTIFY_SOURCE then you will get _runtime_ bounds checking.

So, while you still have to make sure your structure is sane, now the runtime can play along too.

Re:How to use the new counted_by attribute in C (and Linux) by db48x on Saturday July 20, 2024 @05:51PM (#41020307)
True, but compile time warnings beat runtime checks every time. Well, as long as people turn the warnings into errors so that they cannot just be ignored.