bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] canonicalize: add support for not resolving symlinks


From: Eric Blake
Subject: Re: [PATCH] canonicalize: add support for not resolving symlinks
Date: Fri, 30 Dec 2011 09:36:18 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

On 12/30/2011 09:10 AM, Paul Eggert wrote:
> On 12/30/11 05:49, Eric Blake wrote:
>> the gnulib replacement for stat on some platforms has to be a function-like
>> macro (no thanks to 'struct stat')
> 
> Why does the gnulib replacement do that?
> If gnulib instead did "#define stat rpl_stat",
> that would rename 'struct stat' to 'struct rpl_stat',
> but the resulting code would work fine, no?

No, because unless you can declare struct rpl_stat with the same layout
as struct stat, you have an API incompatibility that can cause
compilation errors in various circumstances.

> And we wouldn't have the problem that sparked this thread.

I'd welcome a patch to gnulib to prove me wrong by fixing rpl_stat to be
an object-like instead of function-like macro, all while still allowing
compilation to succeed in all interfaces that take 'struct stat *' as a
parameter, including when using those interfaces via function pointer.

-- 
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]