|
|
Subscribe / Log in / New account

C23 reference links

C23 reference links

Posted Jul 23, 2024 15:29 UTC (Tue) by pbonzini (subscriber, #60935)
In reply to: C23 reference links by fishface60
Parent article: GNU C Library 2.40 released

The main problem is the conflict between realloc(NULL, n), which arguably should be the same as malloc(n), and realloc(ptr, 0).

BSD never freed for realloc(ptr, 0) even if ptr is NULL. AIX never allocated for realloc(NULL, n) even if n is zero. glibc allocated for realloc(NULL, 0), like malloc(0) does, but if n!=0 it freed the pointer.

For more information see https://www.open-std.org/jtc1/sc22/wg14/www/docs/summary....

Here is where the final change was made: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2464.pdf


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds