From owner-freebsd-testing@FreeBSD.ORG Mon Feb 17 06:08:00 2014 Return-Path: Delivered-To: freebsd-testing@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6727097F; Mon, 17 Feb 2014 06:08:00 +0000 (UTC) Received: from mail-pd0-x230.google.com (mail-pd0-x230.google.com [IPv6:2607:f8b0:400e:c02::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28F3D187C; Mon, 17 Feb 2014 06:08:00 +0000 (UTC) Received: by mail-pd0-f176.google.com with SMTP id w10so14419966pde.7 for ; Sun, 16 Feb 2014 22:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=CfFnpBLlA+M+ZbiYZeOJAbS9lBc9L68NnvNXXnrfNf8=; b=QSpbGMMxUy+5HkrlkPC3ZpGil8xlqpOWJVvKngbZ9KiFTX7Q3KzV3fhFNiqi30d5Dz E3Lmb/PiQegDRpHYWYxqWbONz6pQ8EBc7C8oyzk/jixJV0EfLccrs7iDUT2DmXVfNCap IPHWKvJ6fW3x1wMybqalq+utyaoqun2T0f5LeTLgJuEJBzr1M/zRTzNDiz5P2u0cW1B6 5SjVuiIMkUqmX2vub5MVIsQ0Yv5DPrwhGfa3/TjvjpyTgO4ue4HN/W24oO+kV2CSREJW sumiQISrlqsVuZd9BSv773AllWW6hyoGu50KZcpX7iPH+dUfgIG9y7pJz/ZazzNafBHN AXWA== X-Received: by 10.68.129.201 with SMTP id ny9mr24822370pbb.70.1392617279738; Sun, 16 Feb 2014 22:07:59 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:fd41:1b7b:dfb1:40f1? ([2601:8:ab80:7d6:fd41:1b7b:dfb1:40f1]) by mx.google.com with ESMTPSA id sx8sm109038630pab.5.2014.02.16.22.07.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Feb 2014 22:07:58 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: Compile error with gcc From: Garrett Cooper In-Reply-To: Date: Sun, 16 Feb 2014 22:07:55 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <2281FB5D-2BF0-4763-AC24-67EC3864D39B@gmail.com> References: <695E42A3-2009-4DD7-B10E-BF8465C89D39@gmail.com> <849648F5-7834-45DD-8BDF-6385BF4F82DB@FreeBSD.org> To: Julio Merino X-Mailer: Apple Mail (2.1827) Cc: freebsd-testing@FreeBSD.org, David Chisnall , Dimitry Andric X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 06:08:00 -0000 On Feb 16, 2014, at 5:13 AM, Julio Merino wrote: > On Feb 16, 2014, at 8:05, Dimitry Andric wrote: >=20 >> On 16 Feb 2014, at 13:45, Julio Merino wrote: >>> On Feb 16, 2014, at 7:11, Dimitry Andric wrote: >>>>=20 >>>> I don't think this will always work correctly. If MK_LIBCPLUSPLUS = is >>>> defined in bsd.own.mk, it only means libc++ is being *built*, not = that >>>> it is being used. >>>>=20 >>>> It is probably easier and more fool-proof to check if = _LIBCPP_VERSION is >>>> defined (which is the case when you use libc++) in bconfig.h, like = so: >>>>=20 >>>> Index: contrib/atf/bconfig.h >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> --- contrib/atf/bconfig.h (revision 261974) >>>> +++ contrib/atf/bconfig.h (working copy) >>>> @@ -56,7 +56,9 @@ >>>> #define HAVE_UNSETENV 1 >>>>=20 >>>> /* Define to 1 if vsnprintf is in std */ >>>> +#ifdef _LIBCPP_VERSION >>>> #define HAVE_VSNPRINTF_IN_STD 1 >>>> +#endif >>>=20 >>> Let's not do that unless we can change configure.ac to generate = these same contents. >>>=20 >>> Maybe we can just revert this to _not_ define HAVE_VSNPRINTF_IN_STD = as it used to be the case before the new import? Things were working = just fine with both libstdc++ and libc++ even if that setting was not = accurate for the latter... >>=20 >> Well, contrib/atf/atf-c++/detail/application.cpp has: >>=20 >> #if !defined(HAVE_VSNPRINTF_IN_STD) >> namespace std { >> using ::vsnprintf; >> } >> #endif // !defined(HAVE_VSNPRINTF_IN_STD) >>=20 >> so it sort of hacks around it anyway. :-) >=20 > Right, so what does C++ say about this? Is that snippet OK even when = std::vsnprintf is already defined, as is the case for libc++? (I.e. = won't that using directive ever conflict with the library?) >=20 > If the above is true, then I'd just kill the whole = HAVE_VSNPRINTF_IN_STD stupidity from both bconfig.h and application.cpp! Thanks Dimitry for the input. Should this check be done with=85 #if defined(__cplusplus) && __cplusplus >=3D etc, and if so, what c++ standard was vsnprintf incorporated into? It = looks like should be 201103L (c++11) ( = http://en.cppreference.com/w/cpp/io/c/vfprintf ). If so, then the = configure.ac tests should instead set the appropriate -std variable (or = setting), then test for c++=92s existence. Similarly, libc++ might need = to be fixed to scope out -std properly, unless it=92s purely a c++11 and = newer library. Thanks! -Garrett