Hacker News new | ask | show | jobs
by layer8 1171 days ago
While the situation with realloc() is unfortunate, it is also not difficult to write a wrapper that does what the author wants. I’ve done that before, because it has long been known that not all realloc() implementations conform to the (prior) C standard. One can furthermore assume that existing implementations won’t change their behavior just because C23 made it UB.
1 comments

Honestly I'm happy the C standard now address how realloc behaves in detail. It was already hard before, and now it's documented.