This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Unify pthread_spin_[try]lock implementations.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Maxim Kuvyrkov <maxim at codesourcery 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: Wed, 15 Aug 2012 09:56:13 -0700 (PDT)
- 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><AFCB985E-C1C3-49FB-8267-003F6E9D30DB@codesourcery.com>
> 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.
Thanks,
Roland