[v3] c++0x includes

Kaveh R. GHAZI ghazi@caip.rutgers.edu
Tue Mar 6 18:04:00 GMT 2007


On Tue, 6 Mar 2007, Paolo Carlini wrote:

> Hi Kaveh,
>
> >>.../sparc-sun-solaris2.10/libstdc++-v3/include/tr1/cmath:227: error: '::llrint' has not been declared
> >>.../sparc-sun-solaris2.10/libstdc++-v3/include/tr1/cmath:228: error: '::llrintf' has not been declared
> >>.../sparc-sun-solaris2.10/libstdc++-v3/include/tr1/cmath:229: error: '::llrintl' has not been declared
> >>.../sparc-sun-solaris2.10/libstdc++-v3/include/tr1/cmath:231: error: '::llround' has not been declared
> >>.../sparc-sun-solaris2.10/libstdc++-v3/include/tr1/cmath:232: error: '::llroundf' has not been declared
> >>.../sparc-sun-solaris2.10/libstdc++-v3/include/tr1/cmath:233: error: '::llroundl' has not been declared
> >>
> >>
> The strange thing is that, as you can see a few lines above in that
> file, that code is protected by _GLIBCXX_USE_C99_MATH_TR1, which, in
> turn, is defined only if the specific GLIBCXX_CHECK_C99_TR1 test
> succeeds at configure time.
>
> Therefore, I'd ask you to figure out what is going wrong on solaris in
> that chain: apparently _GLIBCXX_USE_C99_MATH_TR1 is defined but llrint &
> co are then not available during the compilation of the testcase.

The reason the configure check passes is that it is run without
-std=c++0x, while the testsuite case fails because it is run with that
flag.  The flag has the effect on solaris of defining _STRICT_STDC which
is a negating wrapping conditional around the prototypes:

#if !defined(_STRICT_STDC) && !defined(_NO_LONGLONG) || defined(_STDC_C99) || \
        defined(__C99FEATURES__)
[...]


The _STRICT_STDC macro gets defined thusly:

#if (__STDC__ - 0 == 1 && !defined(__GNUC__)) || \
        (defined(__GNUC__) && defined(__STRICT_ANSI__))
#define _STRICT_STDC
#else
#undef  _STRICT_STDC
#endif

Since __GNUC__ and __STRICT_ANSI__ are defined, we get _STRICT_STDC.


One solution may be to have G++ define _STDC_C99 or __C99FEATURES__ on
solaris10.  I'm not sure.

Eric, what do you think?  And PS, are you seeing the same thing on your
solaris10 box?

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu



More information about the Libstdc++ mailing list