bug-gnulib
[Top][All Lists]
Advanced

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

Re: strdup


From: Simon Josefsson
Subject: Re: strdup
Date: Thu, 18 Sep 2008 14:14:37 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Hi Simon,
>
>> Are there any platforms we care about that lack strdup?
>> 
>> doc/posix-functions/strdup.texi contains:
>> 
>> Portability problems fixed by Gnulib:
>> @itemize
>> @item
>> This function is missing on some old platforms.
>> @item
>> This function has no prototype in @code{<string.h>} on some old platforms.
>> @end itemize
>> 
>> There are a few gnulib modules that depend directly on strdup.  Several
>> other gnulib modules appear to use strdup without depending on strdup.
>> See grep output below.
>> 
>> I'm wondering if we could remove the dependencies, trusting that
>> maintainers who care about platforms without strdup will add it
>> manually.
>
> It is correct that strdup is available everywhere nowadays. However, we
> might want to change the 'strdup' module so that it provides a POSIX compliant
> function (one that sets errno to ENOMEM when it fails). The module
> does not do so currently.
>
> For reasons like this, I find it better if we leave the explicit dependencies
> in the module descriptions, and if the people who _don't_ want this module
> pass '--avoid=strdup' to gnulib-tool.

I've started to use --avoid=strdup, but I don't understand your reason:
right now strdup doesn't make sure ENOMEM is supported, and it seems
unclear whether the modules that depend on strdup actually require that
behaviour from the strdup module.  So as far as I can tell there is no
reason for the explicit dependency today.

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]