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: What does it mean to include pthread.h with -std=c11?


* Carlos O'Donell:

> On 12/20/19 3:07 PM, Florian Weimer wrote:
>> * Carlos O'Donell:
>> 
>>> I'm on the fence here because it _used_ to work, and so it seems like at
>>> some point we might have gone from (1) -> (2) without a deeper discussion
>>> about exactly what kind of behaviour and maintenance responsibility we want
>>> for these headers.
>>>
>>> Thoughts?
>> 
>> We have a test for this, see scripts/check-installed-headers.sh.  It
>> just fails to catch cases such as this because it cannot test that all
>> the defined macros can be expanded.
>> 
>> I think there are no two sides here.  #include <pthread.h> must work
>> in ISO C mode.  Everything else is just very wrong.
>> 
>> (We even sprinkle __extension across the headers to suppress pedantic
>> warnings.)
>
> I think that poistion is very reasonable, and I think it's what users
> would expect to happen. What do we estimate is our long-term maintenance
> code to support this? Can we expand our testing to look for issues like
> this? 

I think we could have a test that checks that we have a test that
checks that all macros can be expanded (within the required context).
Such a combination of tests would catch issues like this one.

(By the way, we should parallelize the existing test and also add
coverage for additional C++ modes.)


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