This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] Add C11 threads.h support.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Juan Manuel Torres Palma <j dot m dot torrespalma at gmail dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 30 Jun 2015 17:22:47 +0000
- Subject: Re: [RFC] Add C11 threads.h support.
- Authentication-results: sourceware.org; auth=none
- References: <CAD82F-pXPRnsxLtT2pTADWkjsV=m6xA7cDuMX6J_bXW+c=HsVA at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1506262111460 dot 28580 at digraph dot polyomino dot org dot uk> <CAD82F-qU-m19vK43WROzez29vUVREgRS_ohA45tJWwnXUsdkZg at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1506291421270 dot 7278 at digraph dot polyomino dot org dot uk> <CAD82F-rgZp7yJYym+9jL5uYszMoSjSY173+1=E_GhsNQwXEjXg at mail dot gmail dot com>
On Tue, 30 Jun 2015, Juan Manuel Torres Palma wrote:
> I get all of your points now, it's unbelievable how much I'm learning
> during the process, thanks for your guidance.
>
> After running the testsuite I'm getting error regarding the
> linknamespace test and conform test. Conform tests errors don't make
> me worry that much because they seem to appear on other headers too
> and are being ignored. However, in linknamespace test appear a lot of
> new functions that I didn't even think about that seem to be in user's
> namespace.
>
> I attach my threads.h-data, linknamespace.out and conform.out for some
> feedback.
Most conform tests failures should be straightforward to fix. Note that
the results are currently clear for all ISO C versions; it's only other
standards for which they haven't been fully cleaned up yet. You have
errors for the types of thrd_create and thrd_exit. So check the types in
both the header and the expectations.
In the case of thrd_create, it seems you have the wrong type for the first
argument in threads.h-data. In the case of thrd_exit, there may be a
trickier issue involved - try declaring it in the header using
__attribute__ ((__noreturn__)) as done for other non-returning functions
in standard headers, instead of _Noreturn - this is compatible with C11
_Noreturn but the conform tests avoid it causing problems with typeof (for
GNU C typeof, non-returning counts as part of the function's type, which
affects how the tests for types of functions work).
For the linknamespace tests, you'll need to investigate why all the lines
such as
[initial] thrd_create
appear - this indicates something odd going on with the testsuite.
Functions such as thrd_create should, given the makefile changes to add
threads.h to the headers for C11, appear in the generated symlist-ISO11 as
being in the implementation namespace for C11. So you'll need to look at
why list-header-symbols.pl, passed a list of headers including threads.h,
failed to generate output indicating that those symbols are allowed (or
why, if listed as allowed, they still show up as failing).
Then, having resolved that issue so that linknamespace.out only lists
symbols (the last symbol listed on each line is the one that the testsuite
thinks is problematic) that reflect genuine bugs, each of those will need
resolving, by making the relevant code call implementation-namespace
versions. For example, pthread_create will need to call various
__pthread_* functions instead of plain pthread_*.
--
Joseph S. Myers
joseph@codesourcery.com