News for hackers. Stuff that matters.
Re:C: Simple Defer, Ready to Use by pjmlp on Monday January 06, 2025 @05:43PM (#42616921)
The major source of bugs in C is located on string.h, and nothing has been made in 50 years to fix that.

Really fix, not mitigations with their own gotchas.

Re:C: Simple Defer, Ready to Use by Dwedit on Monday January 06, 2025 @06:26PM (#42617316)
There have been things done to try to fix that, see "strcpy_s" and other related functions. Visual Studio even considers use of the classic string functions (like "strcpy") to be a compiler error. You need to define a specific macro before you are allowed to use them.
Re:C: Simple Defer, Ready to Use by e4m2 on Monday January 06, 2025 @07:21PM (#42617737)
The much dreaded Annex K functions are perhaps the worst possible example of an attempt at "fixing" anything safety related in C. A waste of ink.
Re:C: Simple Defer, Ready to Use by pjmlp on Tuesday January 07, 2025 @01:21AM (#42619853)
You missed my second paragraph.