Date: 31 Dec 2012 03:49:51 -0000 From: Michael Gmelin <freebsd@grem.de> To: FreeBSD-gnats-submit@FreeBSD.org Cc: glarkin@FreeBSD.org Subject: ports/174852: [PATCH] devel/zthread: Patch to make zthread work with Clang and recent gcc Message-ID: <20121231034951.62355.qmail@mail.grem.de> Resent-Message-ID: <201212310400.qBV401EZ050455@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 174852 >Category: ports >Synopsis: [PATCH] devel/zthread: Patch to make zthread work with Clang and recent gcc >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Dec 31 04:00:01 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Michael Gmelin >Release: FreeBSD 9.0-RELEASE amd64 >Organization: Grem Equity GmbH >Environment: System: FreeBSD bsd64.grem.de 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC >Description: Scoping issue, won't compile on amd64 using clang. Also a return type specification issue clang is picky about. ../include/zthread/Guard.h:117:9: error: void function 'createScope' should not return a value [-Wreturn-type] return false; ^ ~~~~~ ../include/zthread/Guard.h:121:5: error: void function 'createScope' should not return a value [-Wreturn-type] return true; ../include/zthread/Guard.h:431:38: error: use of undeclared identifier 'extract' LockingPolicy::shareScope(*this, extract(g)); ^ ./ConditionImpl.h:235:40: note: in instantiation of function template specialization 'ZThread::Guard<ZThread::FastLock, ZThread::UnlockedScope>::Guard<ZThread::FastLock, ZThread::LockedScope>' requested here Guard<FastLock, UnlockedScope> g2(g1); ^ Condition.cxx:52:12: note: in instantiation of member function 'ZThread::ConditionImpl<ZThread::fifo_list>::wait' requested here _impl->wait(); ^ ../include/zthread/Guard.h:82:22: note: must qualify identifier to find this declaration in dependent base class static LockHolder& extract(T& t) { Port maintainer (glarkin@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: suffix) >How-To-Repeat: Build using clang or gcc46/gcc47 >Fix: Apply the attached patch to specify the correct scope. --- zthread-2.3.2_2.patch begins here --- diff -ruN --exclude=CVS ../zthread.orig/Makefile ./Makefile --- ../zthread.orig/Makefile 2012-12-31 04:26:47.126767001 +0100 +++ ./Makefile 2012-12-31 04:29:27.803847188 +0100 @@ -1,13 +1,9 @@ -# New ports collection makefile for: ZThread -# Date created: 23 May 2001 -# Whom: pvh@egenetics.com -# -# $FreeBSD: ports/devel/zthread/Makefile,v 1.29 2012/11/17 05:57:07 svnexp Exp $ -# +# Created by: pvh@egenetics.com +# $FreeBSD: $ PORTNAME= zthread PORTVERSION= 2.3.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= SF/${PORTNAME}/ZThread/${PORTVERSION} DISTNAME= ZThread-${PORTVERSION} diff -ruN --exclude=CVS ../zthread.orig/files/patch-include__zthread__Guard.h ./files/patch-include__zthread__Guard.h --- ../zthread.orig/files/patch-include__zthread__Guard.h 2012-12-31 04:26:47.103633055 +0100 +++ ./files/patch-include__zthread__Guard.h 2012-12-31 04:42:24.083650068 +0100 @@ -1,5 +1,32 @@ ---- ./include/zthread/Guard.h.orig 2005-03-12 21:10:09.000000000 -0500 -+++ ./include/zthread/Guard.h 2009-04-23 15:03:09.000000000 -0400 +--- ./include/zthread/Guard.h.orig 2005-03-13 03:10:09.000000000 +0100 ++++ ./include/zthread/Guard.h 2012-12-31 04:25:54.167937596 +0100 +@@ -108,7 +108,7 @@ + } + + template <class LockType> +- static void createScope(LockHolder<LockType>& l, unsigned long ms) { ++ static bool createScope(LockHolder<LockType>& l, unsigned long ms) { + + if(Scope1::createScope(l, ms)) + if(!Scope2::createScope(l, ms)) { +@@ -428,7 +428,7 @@ + template <class U, class V> + Guard(Guard<U, V>& g) : LockHolder<LockType>(g) { + +- LockingPolicy::shareScope(*this, extract(g)); ++ LockingPolicy::shareScope(*this, this->extract(g)); + + } + +@@ -458,7 +458,7 @@ + template <class U, class V> + Guard(Guard<U, V>& g, LockType& lock) : LockHolder<LockType>(lock) { + +- LockingPolicy::transferScope(*this, extract(g)); ++ LockingPolicy::transferScope(*this, this->extract(g)); + + } + @@ -491,7 +491,7 @@ try { --- zthread-2.3.2_2.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121231034951.62355.qmail>