bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib portability issues


From: Eric Blake
Subject: Re: gnulib portability issues
Date: Mon, 11 Jun 2012 07:37:16 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 06/11/2012 07:19 AM, Rich Felker wrote:

> But if your goal is to read up until the next character in a
> particular set of special characters, why not fscanf(f, "%100[^xyz]",
> ...) with 100 replaced by your buffer size and xyz replaced by the
> specials? 

Because fscanf() is broken by design.  M4 refuses to use it, because
there is no portable way to use it on numeric parsing while still
detecting overflow, and because gnulib refuses to implement an fscanf()
replacement that works around the many different libc bugs in fscanf()
compliance because *scanf is so broken by design.

>> Depending on the function name you choose, we would have to add an m4
>> check to see if __freadahead() is defined; but once we know the name of
>> the function to check for at configure time, then it is quite simple to
>> code up gnulib's freadahead.c to call into the internal __freadahead()
>> function of libc, when one exists.
> 
> So right now, for DragonFly, it's just hard-coded? If you're willing
> to put in a test for it, I'm willing to add the function.

Yes, we are willing to do a configure-time link test for any internal
function name you are willing to give us.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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