From owner-freebsd-testing@FreeBSD.ORG Mon Feb 17 13:57:08 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 C039C2C8; Mon, 17 Feb 2014 13:57:08 +0000 (UTC) Received: from blu0-omc1-s15.blu0.hotmail.com (blu0-omc1-s15.blu0.hotmail.com [65.55.116.26]) by mx1.freebsd.org (Postfix) with ESMTP id 82E191458; Mon, 17 Feb 2014 13:57:08 +0000 (UTC) Received: from BLU0-SMTP333 ([65.55.116.9]) by blu0-omc1-s15.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 17 Feb 2014 05:56:02 -0800 X-TMN: [ILbSt8UDzZIW2fp5A2YfD/ipPrnFOf1N] X-Originating-Email: [jmmv@outlook.com] Message-ID: Received: from lime.meroh.net ([108.176.158.82]) by BLU0-SMTP333.blu0.hotmail.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 17 Feb 2014 05:56:00 -0800 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: Julio Merino In-Reply-To: <2281FB5D-2BF0-4763-AC24-67EC3864D39B@gmail.com> Date: Mon, 17 Feb 2014 08:55:59 -0500 Content-Transfer-Encoding: quoted-printable References: <695E42A3-2009-4DD7-B10E-BF8465C89D39@gmail.com> <849648F5-7834-45DD-8BDF-6385BF4F82DB@FreeBSD.org> <2281FB5D-2BF0-4763-AC24-67EC3864D39B@gmail.com> To: Garrett Cooper X-Mailer: Apple Mail (2.1827) X-OriginalArrivalTime: 17 Feb 2014 13:56:00.0654 (UTC) FILETIME=[FD7162E0:01CF2BE7] 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 13:57:08 -0000 On Feb 17, 2014, at 01:07 , Garrett Cooper wrote: >=20 > Thanks Dimitry for the input. >=20 > Should this check be done with=85 >=20 > #if defined(__cplusplus) && __cplusplus >=3D I'm not sure it's going to work. I think Dimitry mentioned that our = libstdc++ should already provide std::vsnprintf, but due to the flags = it's built with, it doesn't. I'm not sure if, due to this, the version = check above would do the right thing. > 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. The point of tests in configure.ac scripts is to _not_ do the above = style of checks. If you are going to use those, then you don't need = configure because you can stick those into the code: configure should be = checking what the compiler actually does, not what it claims to support. = This way the checks are future-proof and are going to work even for = compilers you have not tried yet. Note that the check in configure.ac is working just fine and that's not = the problem. The problem is in FreeBSD, where we have a single = bconfig.h for the two compilers and the two compilers behave differently = in at least one of the detected settings. So... we could generate two bconfig.h files, one for each compiler, and = use them accordingly... or we could try to eliminate the divergence = altogether. To do the latter, I think it's enough to remove the = conditional and leave the code doing: namespace std { using ::vsnprintf; } in all cases. It works in clang but I don't know what the standard has = to say in this regard! (FYI: I fixed the immediate problem in HEAD by changing bconfig.h to = #undef the setting -- just as we had been doing since the initial import = of ATF.)=