Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libpthread



On Fri, Jun 26, 2015 at 12:49:09PM +0000, Antti Kantee wrote:
> This is the simplest program to repeat the problem with g++ 5.1 and NetBSD's
> pthread_types.h:
> 
> #include <pthread.h>
> class foo {
> 	pthread_mutex_t m;
> public:
> 	constexpr foo() : m(PTHREAD_MUTEX_INITIALIZER) {}
> };
> 
> (plus or minus typos since I typed it by hand from the virtual machine
> console)
> 
> If there's some way to say "pthread_types.h is even more of a system header
> than with -isystem and compilers should not generate errors", then I'd like
> to hear it.

You don't understand. The system header is not pthread_types.h, it is
<mutex>.

> Also, if this is really the correct DR, I'm not sure how a flaw in the
> standard translates to "gcc bug"
> http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1911
> (especially when there's no fix for the defect in the standard)

The fix is to apply the C++14 rules, which is more relaxed.

> So, I really don't see how to sweep the issue under the rug except by a)
> figuring out a workaround b) labeling all C++ compilers which happen to
> implement the current standard as incompatible with NetBSD.

DRs are retroactive, e.g. bug fixes and corrections. As such they are
part of "the current standard" (and of course, it is not the current
standard, since that would be C++14).

Joerg


Home | Main Index | Thread Index | Old Index