This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Unify pthread_spin_[try]lock implementations.


On 16/08/2012, at 4:56 AM, Roland McGrath wrote:

>> This works at least with GCC 4.4 and GCC 4.8, albeit with a warning:
>> 
>> ../ports/sysdeps/mips/nptl/pthread_spin_lock.c:19:2: warning: #include_next in primary source file [enabled by default]
>> #include_next <nptl/pthread_spin_lock.c>
>>  ^
> 
> Right.  We don't want that.
> 
>> Given that previous versions of GCC can, potentially, fail to compile
>> this, I would rather use the "../../../../nptl/pthread_spin_lock.c"
>> version.  Any alternative suggestions?
> 
> Anything that depends on the location of the source file is a bad idea.
> It will break if things get moved around, and perhaps nonobviously.
> You could use <sysdeps/../nptl/foo.c> but it merits a comment about why
> the more common and simple <nptl/foo.c> is not being used.

Yep, this looks good.  I'll test this and add comments to all affected places.

--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]