From owner-freebsd-ports-bugs@FreeBSD.ORG Sun May 20 22:00:11 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9EC6616A421 for ; Sun, 20 May 2007 22:00:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 7F15413C46E for ; Sun, 20 May 2007 22:00:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l4KM0BG1035668 for ; Sun, 20 May 2007 22:00:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l4KM0BZB035662; Sun, 20 May 2007 22:00:11 GMT (envelope-from gnats) Resent-Date: Sun, 20 May 2007 22:00:11 GMT Resent-Message-Id: <200705202200.l4KM0BZB035662@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Henrik Brix Andersen Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBC3316A41F for ; Sun, 20 May 2007 21:53:50 +0000 (UTC) (envelope-from brix@lothlorien.brixandersen.dk) Received: from solow.pil.dk (relay.pil.dk [195.41.47.164]) by mx1.freebsd.org (Postfix) with ESMTP id 660D513C46E for ; Sun, 20 May 2007 21:53:50 +0000 (UTC) (envelope-from brix@lothlorien.brixandersen.dk) Received: from lothlorien.brixandersen.dk (osgiliath.brixandersen.dk [87.53.223.189]) by solow.pil.dk (Postfix) with ESMTP id 863601CC0F0; Sun, 20 May 2007 23:53:49 +0200 (CEST) Received: by lothlorien.brixandersen.dk (Postfix, from userid 1001) id EC85B11420; Sun, 20 May 2007 23:53:48 +0200 (CEST) Message-Id: <20070520215348.EC85B11420@lothlorien.brixandersen.dk> Date: Sun, 20 May 2007 23:53:48 +0200 (CEST) From: Henrik Brix Andersen To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: novel@FreeBSD.org Subject: ports/112821: [patch] Make x11-wm/fbpager compile with gcc-4.2 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Henrik Brix Andersen List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2007 22:00:11 -0000 >Number: 112821 >Category: ports >Synopsis: [patch] Make x11-wm/fbpager compile with gcc-4.2 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 20 22:00:10 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Henrik Brix Andersen >Release: FreeBSD 7.0-CURRENT i386 >Organization: pil.dk >Environment: System: FreeBSD lothlorien.brixandersen.dk 7.0-CURRENT FreeBSD 7.0-CURRENT #34: Sun May 20 13:14:49 CEST 2007 root@lothlorien.brixandersen.dk:/usr/obj/usr/src/sys/LOTHLORIEN i386 >Description: Currently, x11-wm/fbpager doesn't compile with gcc-4.2 as found in recent -CURRENT: source='main.cc' object='fbpager-main.o' libtool=no depfile='.deps/fbpager-main.Po' tmpdepfile='.deps/fbpager-main.TPo' depmo de=gcc3 /bin/sh ../depcomp c++ -DHAVE_CONFIG_H -I. -I. -I.. -IFbTk -O2 -fno-strict-aliasing -pipe -march=prescott -I/usr/l ocal/include -c -o fbpager-main.o `test -f main.cc || echo './'`main.cc source='FbPager.cc' object='fbpager-FbPager.o' libtool=no depfile='.deps/fbpager-FbPager.Po' tmpdepfile='.deps/fbpager-FbPager .TPo' depmode=gcc3 /bin/sh ../depcomp c++ -DHAVE_CONFIG_H -I. -I. -I.. -IFbTk -O2 -fno-strict-aliasing -pipe -march=presco tt -I/usr/local/include -c -o fbpager-FbPager.o `test -f FbPager.cc || echo './'`FbPager.cc In file included from FbPager.cc:40: Resources.hh:13: error: specialization of 'void FbTk::Resource::setFromString(const char*) [with T = bool]' in different nam espace Resources.hh:13: error: from definition of 'void FbTk::Resource::setFromString(const char*) [with T = bool]' Resources.hh:23: error: specialization of 'std::string FbTk::Resource::getString() [with T = bool]' in different namespace Resources.hh:23: error: from definition of 'std::string FbTk::Resource::getString() [with T = bool]' Resources.hh:28: error: specialization of 'void FbTk::Resource::setFromString(const char*) [with T = std::basic_string, std::allocator >]' in different namespace Resources.hh:28: error: from definition of 'void FbTk::Resource::setFromString(const char*) [with T = std::basic_string, std::allocator >]' Resources.hh:33: error: specialization of 'std::string FbTk::Resource::getString() [with T = std::basic_string, std::allocator >]' in different namespace Resources.hh:33: error: from definition of 'std::string FbTk::Resource::getString() [with T = std::basic_string, std::allocator >]' Resources.hh:38: error: specialization of 'void FbTk::Resource::setFromString(const char*) [with T = int]' in different name space Resources.hh:38: error: from definition of 'void FbTk::Resource::setFromString(const char*) [with T = int]' Resources.hh:45: error: specialization of 'std::string FbTk::Resource::getString() [with T = int]' in different namespace Resources.hh:45: error: from definition of 'std::string FbTk::Resource::getString() [with T = int]' Resources.hh:53: error: specialization of 'void FbTk::Resource::setFromString(const char*) [with T = FbPager::FbPager::Align ment]' in different namespace Resources.hh:53: error: from definition of 'void FbTk::Resource::setFromString(const char*) [with T = FbPager::FbPager::Al ignment]' Resources.hh:61: error: specialization of 'std::string FbTk::Resource::getString() [with T = FbPager::FbPager::Alignment]' i n different namespace Resources.hh:61: error: from definition of 'std::string FbTk::Resource::getString() [with T = FbPager::FbPager::Alignment] ' FbPager.cc: In constructor 'FbPager::FbPager::FbPager(int, bool, bool, bool, bool, const char*)': FbPager.cc:271: warning: deprecated conversion from string constant to 'char*' FbPager.cc:277: warning: deprecated conversion from string constant to 'char*' FbPager.cc:278: warning: deprecated conversion from string constant to 'char*' *** Error code 1 >How-To-Repeat: On a -CURRENT box with gcc-4.2: # cd /usr/ports/x11-wm/fbpager # make >Fix: The patch below was taken from Gentoo Linux Bugzilla, originally submitted by Ryan Hill. See http://bugs.gentoo.org/135504 It fixes the build with gcc-4.2 for me. --- patch-Resources.hh begins here --- --- src/Resources.hh +++ src/Resources.hh @@ -8,8 +8,10 @@ #include #include +namespace FbTk { + template<> -void FbTk::Resource:: +void Resource:: setFromString(char const *strval) { if (strcasecmp(strval, "true") == 0 || strcasecmp(strval, "yes") == 0) @@ -19,38 +21,37 @@ } template<> -std::string FbTk::Resource:: +std::string Resource:: getString() { return std::string(**this == true ? "true" : "false"); } template <> -void FbTk::Resource::setFromString(const char *str) { +void Resource::setFromString(const char *str) { *(*this) = (str ? str : ""); } template <> -std::string FbTk::Resource::getString() { +std::string Resource::getString() { return *(*this); } template <> -void FbTk::Resource::setFromString(const char *str) { +void Resource::setFromString(const char *str) { if (str == 0) return; sscanf(str, "%d", &(*(*this))); } template <> -std::string FbTk::Resource::getString() { +std::string Resource::getString() { char buff[16]; sprintf(buff, "%d", (*(*this))); return std::string(buff); } -namespace FbPager { template <> -void FbTk::Resource::setFromString(const char *str) { +void Resource::setFromString(const char *str) { if (strcmp("TopToBottom", str) == 0) *(*this) = FbPager::FbPager::TOP_TO_BOTTOM; else @@ -58,7 +59,7 @@ } template <> -std::string FbTk::Resource::getString() { +std::string Resource::getString() { switch (*(*this)) { case FbPager::FbPager::LEFT_TO_RIGHT: return "LeftToRight"; @@ -67,6 +68,6 @@ } } -} // end namespace FbPager +} // end namespace FbTk #endif // RESOURCES --- patch-Resources.hh ends here --- >Release-Note: >Audit-Trail: >Unformatted: