From 7088070459de5b8e6804d893ebcb4fdd89fba584 Mon Sep 17 00:00:00 2001 From: pooka Date: Fri, 26 Jun 2015 10:25:41 +0000 Subject: [PATCH] document g++ 5.1 + libpthread volatile workaround (PR lib/49989) --- doc/HACKS | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/doc/HACKS b/doc/HACKS index 88c7fc56c132..20abce46b5f3 100644 --- a/doc/HACKS +++ b/doc/HACKS @@ -1,4 +1,4 @@ -# $NetBSD: HACKS,v 1.159 2015/05/08 09:44:45 martin Exp $ +# $NetBSD: HACKS,v 1.160 2015/06/26 10:25:41 pooka Exp $ # # This file is intended to document workarounds for currently unsolved # (mostly) compiler bugs. @@ -381,6 +381,28 @@ descr used in the link(2) system call. kcah +hack g++ 5.1 barfs on volatile in initializers +cdata 26 Jun 2015 +who pooka +file src/lib/libpthread/pthread_types.h : 1.14 +file src/lib/libpthread/pthread_types.h : 1.15 +pr lib/49989 +descr + Trying to use e.g. pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER + in C++ results in: + error: temporary of non-literal type '__pthread_mutex_st' + in a constant expression + constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {} + [...] + include/pthread_types.h:101:8: note: '__pthread_mutex_st' is + not literal because: + struct __pthread_mutex_st { + ^ + include/pthread_types.h:103:17: note: non-static data + member '__pthread_mutex_st::ptm_errorcheck' has volatile type + pthread_spin_t ptm_errorcheck; +kcah + port vax hack gcc4/vax ICE