News for hackers. Stuff that matters.
Re:Show HN: My C compiler compiled itself by KerrAvon on Wednesday December 04, 2024 @12:19PM (#42319611)
If you're implementing C23 compatibility, you could do

  auto p = (thing_t *)malloc(sizeof(thing_t));
and you get both DRY and avoid (void *) casting.
Re:Show HN: My C compiler compiled itself by dcuthbertson on Wednesday December 04, 2024 @02:08PM (#42320834)
> and you get both DRY and avoid (void *) casting.

While that line of code is DRY, it doesn't avoid casting "void *" to "thing_t *".