[PATCH] Unify pthread_spin_[try]lock implementations.
Roland McGrath
roland@hack.frob.com
Wed Aug 15 16:56:00 GMT 2012
> 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
More information about the Libc-alpha
mailing list