Source-Changes-D archive

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

Re: CVS commit: src/lib/libpthread



Returning to this pickle.

On 26/06/15 18:24, Joerg Sonnenberger wrote:
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).

I started work on this again by doing a web search for the error, and found this:
http://bugs.musicpd.org/view.php?id=4110

There you argue that using constexpr for PTHREAD_MUTEX_INITIALIZER is broken. So if we assume that you are correct, shouldn't we remove the "constexpr"s from libc++/dist/libcxx/include/__mutex_base?

Home | Main Index | Thread Index | Old Index