This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] Unify pthread_spin_[try]lock implementations.
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Andrew Haley <aph at redhat dot com>, David Miller <davem at davemloft dot net>, "Joseph S. Myers" <joseph at codesourcery dot com>, Richard Sandiford <rdsandiford at googlemail dot com>, <libc-ports at sourceware dot org>, GLIBC Devel <libc-alpha at sourceware dot org>, Chris Metcalf <cmetcalf at tilera dot com>
- Date: Thu, 16 Aug 2012 04:52:39 +1200
- Subject: Re: [PATCH] Unify pthread_spin_[try]lock implementations.
- References: <Pine.LNX.4.64.1206282306320.20312@digraph.polyomino.org.uk> <65B470D2-4D01-4BA1-AEC5-A72C0006EA22@codesourcery.com> <20120711081441.73BB22C093@topped-with-meat.com> <20120711.012509.1325789838255235021.davem@davemloft.net> <4FFD3CD9.4030206@redhat.com> <84304C03-6A49-4263-9016-05486EDC0E98@codesourcery.com> <4FFD4114.9000806@redhat.com> <E1DB09C1-0E3E-4088-9793-C0CAB80B5084@codesourcery.com> <20120711112235.B28CA2C099@topped-with-meat.com> <7FBB4F87-9FF3-4239-818F-5A38C8094011@codesourcery.com> <20120725181300.DD1812C0B5@topped-with-meat.com> <36A2FFD8-0C98-4AB6-8C64-2EEC5CC67A63@codesourcery.com> <20120815162637.B74982C0F2@topped-with-meat.com> <BE128C9A-CABC-4E04-A48E-316EAE8E0C64@codesourcery.com> <20120815164350.7BE932C105@topped-with-meat.com>
On 16/08/2012, at 4:43 AM, Roland McGrath wrote:
>> This is just an indentation artifact in git commit log. It will be
>> properly formatted in the actual ChangeLog file.
>
> OK. Note that we don't use long things like ChangeLog fragments for the
> git commit messages, just a short subject line.
>
>> The machine-specific pthread_spin_lock.c files go to
>> ports/sysdeps/<machine>/nptl/pthread_spin_lock.c, which comes first in
>> sysdeps search path before the generic nptl/pthread_spin_lock.c. So it
>> is either '#include_next <nptl/pthread_spin_lock.c>' or '#include
>> "../../../../nptl/pthread_spin_lock.c"'. The former looks less ugly than
>> the later.
>
> Hmm. Last I knew #include_next from a main source file didn't work as you
> expect. Did GCC change?
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>
^
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?
Thanks,
--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics