This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] mtrace: properly handle realloc (p, 0)


On Wed, 2 Jan 2013, Rich Felker wrote:

> POSIX has rewritten the specification of realloc in terms of changing
> the size of an object, a concept that does not exist in plain C (for
> very good reason).

No, it's based the specification on C90, where it starts "The realloc 
function changes the size of the object".  Both C99 and POSIX then made 
changes from the C90 basis [*], resulting in various confusion when they 
ended up not meaning quite the same thing (along with different 
interpretations of the C90 text by different implementations, I expect).

[*] It's possible the divergence started longer ago and that the 1984 
/usr/group standard was the most recent common ancestor of this text (for 
C90 and SVID, and so now for C11 via C90 and C99, and POSIX via XPG3, XPG4 
and Unix98).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]