error compiling c++ sample - old creepy gcc bug spotted

Markus Pfeiffer markus.pfeiffer at morphism.de
Tue Aug 12 02:09:44 PDT 2014


Hi,


On Tue, Aug 12, 2014 at 12:17:44AM +0200, John Marino wrote:
> On 8/11/2014 23:39, Volodymyr Kostyrko wrote:
> > Hi all.
> > 
> > There goes a reduced test case that compiles smoothly on FreeBSD
> > 10/CentOS 6 but fails on DragonFly 3.8.1 / master:
> > 
> > #include <string>
> > 
> > int main()
> > {
> >     std::to_string(0);
> >     return 0;
> > }
> > 
> > The problem is described at
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015 and it states that
> > this is due defining _GLIBCXX_HAVE_BROKEN_VSWPRINTF somewhere. But I
> > can't find where it can be defined in /usr/src. Can someone help me
> > debug this issue?
> > 
> 
> grok.dragonflybsd.org says it's not defined in /usr/src.  I didn't see
> it recursively in /usr/src/gnu either.
>

This is due to the fact that _GLIBCXX_HAVE_BROKEN_VSWPRINTF is not defined.
The reason why this doesn't work is a different one: Looking in 
/usr/include/c++/4.7/bits/basic_string.h we find the following ifdef guard:

#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99) \
     && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))

A quick test program revals that _GLIBCXX_USE_C99 is not set. This is due to
os_defines.h not enabling it, so as far as I can tell, yes it's a compiler
configuration issue, just not the one mentioned in the above mentioned bug
report.

HTH,
Markus 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20140812/fa700f7a/attachment-0016.bin>


More information about the Users mailing list