bug-gnulib
[Top][All Lists]
Advanced

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

Re: working with "good enough" functions


From: Simon Josefsson
Subject: Re: working with "good enough" functions
Date: Sun, 18 Jan 2009 14:06:50 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Mike Frysinger and Simon Josefsson wrote:
>> >> If this happens often enough, perhaps gnulib should have a
>> >> printf-posix-no-fp module that does what you want?
>> >
>> > i would certainly use it, but if i'm the only one expressing interest thus 
>> > far, then maybe it isnt a hot issue.
>> 
>> I see that some *printf objects from gnulib are linked into builds even
>> on glibc platforms.  If that would be fixed by using a module
>> printf-posix-no-fp, I would use it.  (My projects rarely use
>> float/double.)
>
> But "rarely" does not mean "never". The point of the gnulib substitutes is
> that you can use %zd, %f, etc. in your format strings and don't need to
> worry about platforms or compatibility.
>
> If someone is to introduce yet another variant *iprintf for format strings
> that contain only integer/pointer/character/string directives and no
> floating-point directives, then it reduces the reliability of your program:
> If you happen to use %f in such a place nevertheless, the compiler will not
> be able to warn you. (GCC supports an attribute __printf__ but none for
> __iprintf__.)
>
> I would let things lie as they are: Nowadays, executable size is not critical
> any more.

I don't feel strongly.  I think it would be nice if there were a way to
parametrize gnulib modules, so the maintainer can specify which
properties of the gnulib replacement are interesting.  This needs to be
combined with good error handling though, when the project ends up
calling the gnulib replacement in a way the requires additional
properties to be requested.

I'm not sure this will be worth the complexity in the end, so I have no
problem letting things lie as they are.

/Simon




reply via email to

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