Date: Sun, 16 Feb 2014 13:11:19 +0100 From: Dimitry Andric <dim@FreeBSD.org> To: Garrett Cooper <yanegomi@gmail.com> Cc: Julio Merino <julio@meroh.net>, freebsd-testing@FreeBSD.org, David Chisnall <theraven@FreeBSD.org> Subject: Re: Compile error with gcc Message-ID: <D10C2EBB-36EC-4292-A944-4356EA5657F2@FreeBSD.org> In-Reply-To: <A8EF2DCC-5F11-4405-88D1-05A193AB7BAF@gmail.com> References: <695E42A3-2009-4DD7-B10E-BF8465C89D39@gmail.com> <A8EF2DCC-5F11-4405-88D1-05A193AB7BAF@gmail.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On 16 Feb 2014, at 08:28, Garrett Cooper <yanegomi@gmail.com> wrote:
> On Feb 15, 2014, at 9:25 PM, Garrett Cooper <yaneurabeya@gmail.com> wrote:
>
>> Hi Julio,
>> I ran into this error when trying to compile ATF with gcc on code based off of r261958:
>>
>> --- application.So ---
>> /usr/src/contrib/atf/atf-c++/detail/application.cpp: In constructor 'atf::application::usage_error::usage_error(const char*, ...)':
>> /usr/src/contrib/atf/atf-c++/detail/application.cpp:71: error: 'vsnprintf' is not a member of 'std'
>> *** [application.So] Error code 1
>>
>> I haven’t dug into why this is occurring yet, but I assume it’s because of the ATF 0.20 upgrade.
>> I’m compiling with gcc/g++ of course, and not clang/libcxxrt.
>
> This patch seems to work with gcc and clang/libcxxrt. I didn’t try it without clang/libcxxrt though...
> Thanks!
> -Garrett
>
> <0001-Unbreak-compiling-ATF-after-the-0.20-upgrade-with-gc.patch>
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.
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:
Index: contrib/atf/bconfig.h
===================================================================
--- contrib/atf/bconfig.h (revision 261974)
+++ contrib/atf/bconfig.h (working copy)
@@ -56,7 +56,9 @@
#define HAVE_UNSETENV 1
/* Define to 1 if vsnprintf is in std */
+#ifdef _LIBCPP_VERSION
#define HAVE_VSNPRINTF_IN_STD 1
+#endif
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
Finally, please note that libstdc++'s cstdio header *does* have a
declaration for vsnprintf(), but it is only active when _GLIBCXX_USE_C99
is defined. Unfortunately, the libstdc++ configure script does not
define that variable when you run it, since according to the script,
we lack a few C99 maths functions.
-Dimitry
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
iEYEARECAAYFAlMAqvAACgkQsF6jCi4glqNzBgCfdDUjfxA7jhMNz95QsV+p4+0g
DQYAn2+kREo6Yl0M9GG6H3LEgtvdWiy9
=Urju
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D10C2EBB-36EC-4292-A944-4356EA5657F2>
