[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patches] Fix *asprintf() to be compatible with *BSD and sanity

On Wed, 6 May 2009, James Antill wrote:

>  Sorry for not knowing about EGLIBC until you hit LWN, but anyway...
>  Here is a, hopefully self explanatory, patch to fix *asprintf() to be
> compatible with *BSD and what any sane C programmers expects. Drepper
> NAKd it years ago...

Although I think this specification is better than what glibc presently 
does, these interfaces (asprintf, vasprintf, aswprintf, vaswprintf) are 
currently undergoing a standardization process in WG14 (WDTR 24731-2, WG14 
document N1337).  So the best way to ensure that the desired semantics 
become portably available in future might be to make sure WG14 is aware of 
the issue and to put the case for the BSD semantics to them.  I'm not sure 
if non-members can post to the WG14 reflector (sc22wg14 at open-std.org) 
or not; you can certainly write up a document and send it to the convenor 
to go in a WG14 mailing, though.

So I'd suggest raising the issue with WG14, and unless they come up with 
good reasons the BSD semantics are problematic then I'm inclined to put 
this in EGLIBC as being a compatibility bug fix.

> diff --git a/ChangeLog b/ChangeLog
> index 0890030..e95f131 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,9 @@
> +2009-05-06  James Antill  <james@xxxxxxx>
> +
> +	* libio/vasprintf.c (_IO_vasprintf): Make return pointer defined.
> +
> +	* debug/vasprintf_chk.c (__vasprintf_chk): Make return pointer defined.
> +

Note that ChangeLog changes should not be sent as diffs; they'll never 
apply cleanly, and we use ChangeLog.eglibc for changes made in EGLIBC.

Joseph S. Myers