bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] use unlocked io in getdelim


From: Simon Josefsson
Subject: Re: [PATCH] use unlocked io in getdelim
Date: Fri, 29 Aug 2008 16:34:09 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Simon Josefsson wrote:
>> I'd prefer to solve it by having m4 code check whether
>> the non-portable code works or not, and then AC_SUBST in the proper
>> replacement function, either getline-fast.c or getline-slow.c.  This
>> allows a gnulib module 'getline-slow' for when people prefer a small and
>> simple implementation over a faster but more complex.
>
> Even in this scenario, I would prefer a constant conditional that chooses
> among two implementation. This allows to keep common parts of the two
> implementations in one place, and guarantees that the unused code is
> still syntactically checked by the compiler - guarding against bitrot.

Yes, that's a good idea.  Possibly it could be done with #include's of
*.c files, in order to retain the functions in different files.

/Simon




reply via email to

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