From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 1 13:31:22 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A266590C; Fri, 1 Feb 2013 13:31:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8658D752; Fri, 1 Feb 2013 13:31:20 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA19836; Fri, 01 Feb 2013 15:31:19 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <510BC3A7.5040405@FreeBSD.org> Date: Fri, 01 Feb 2013 15:31:19 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130113 Thunderbird/17.0.2 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: base gcc and _GLIBCXX_USE_C99 References: <5106953E.2020907@FreeBSD.org> <510BBCAD.3070705@FreeBSD.org> <510BBE48.4070101@FreeBSD.org> In-Reply-To: <510BBE48.4070101@FreeBSD.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: toolchain@FreeBSD.org, freebsd-hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 13:31:22 -0000 on 01/02/2013 15:08 Dimitry Andric said the following: > On 2013-02-01 14:01, Andriy Gapon wrote: >> on 28/01/2013 17:11 Andriy Gapon said the following: >>> I wonder why the following is the case for the base gcc. >>> /usr/include/c++/4.2/bits/c++config.h: >>> >>> /* Define if C99 functions or macros from , , , >>> , and can be used or exposed. */ >>> /* #undef _GLIBCXX_USE_C99 */ >>> >>> Because of this undef there is no e.g. std::strtoll(). >>> Ditto for other things in stdlib.h. > > Maybe this support can't be enabled, because we don't expose all the > required functions yet? Or maybe it is just something that was > committed years ago, and then forgotten. > > If we are sure that all the C99 functions libstdc++ requires are now > available and working, I see no problem in turning on _GLIBCXX_USE_C99. Having looked into the source code of a recent GCC I get an impression that this is a silliness on GCC's part (plus incompleteness of FreeBSD C99 support, it seems). cstdlib would provide e.g. std::strtoull only when _GLIBCXX_USE_C99 is defined. Now looking at libstdc++-v3/acinclude.m4 we can see that there is a dedicated check "for ISO C99 support in ". That check sets variable glibcxx_cv_c99_stdlib. But, _GLIBCXX_USE_C99 is set only if all of glibcxx_cv_c99_math, glibcxx_cv_c99_complex, glibcxx_cv_c99_stdio, glibcxx_cv_c99_stdlib and glibcxx_cv_c99_wchar are set. So if glibcxx_cv_c99_stdlib is yes, but something like glibcxx_cv_c99_complex is no, then no std::strtoull for me. Not sure why GCC couldn't have a dedicated macro "_GLIBCXX_USE_C99_STDLIB" like e.g. _GLIBCXX_USE_C99_MATH that it does have. -- Andriy Gapon