mandatory-cxx11 on Cygwin doesn't have to_string

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

mandatory-cxx11 on Cygwin doesn't have to_string

Stephen Leake-3
Cygwin g++ is:

g++ --version
g++ (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.

Cygwin does not provide "to_string" in the "<string>" header:

../mandatory-cxx11/src/sanity.cc:38:12: error: ‘std::to_string’ has not
been declared

(even after adding "#include <string>")

searching for "to_string" in /usr/include turns up boost references
only.

reverting all uses of to_string, stoi, and similar lexical casts lets
mtn compile.

Any clues?

--
-- Stephe

_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
Reply | Threaded
Open this post in threaded view
|

Re: mandatory-cxx11 on Cygwin doesn't have to_string

Stephen Leake-3
Stephen Leake <[hidden email]> writes:

> reverting all uses of to_string, stoi, and similar lexical casts lets
> mtn compile.

And pass all tests.

--
-- Stephe

_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
Reply | Threaded
Open this post in threaded view
|

Re: mandatory-cxx11 on Cygwin doesn't have to_string

Markus Wanner-2
In reply to this post by Stephen Leake-3
On 05/20/2014 01:15 AM, Stephen Leake wrote:
> Cygwin does not provide "to_string" in the "<string>" header:
>
> ../mandatory-cxx11/src/sanity.cc:38:12: error: ‘std::to_string’ has not
> been declared

Yeah, I noticed these as well. Build animal porcupine (build 29) shows
pretty much that same error. So does the alpaca (a NetBSD 6.1 box, see
its build 25).

> (even after adding "#include <string>")

Note that base.hh already includes <string>, so that's unlikely to make
a difference.

> searching for "to_string" in /usr/include turns up boost references
> only.

On Cygwin, the stdc++ headers live under /usr/lib/gcc/.

> Any clues?

The root cause seems to be that C99 has been disabled for the c++
standard library. See its bits/c++config.h:

/* Define if C99 functions or macros from <wchar.h>, <math.h>, <complex.h>,
   <stdio.h>, and <stdlib.h> can be used or exposed. */
/* #undef _GLIBCXX_USE_C99 */

I'm not sure what lead to that decision.

I tried to upgrade g++ and the libstdc++ to 4.9.0-1 on cygwin, but that
fails even more substantially (and still doesn't define _GLIBCXX_USE_C99
it c++config.h).

Bottom line: It looks like we're stuck with boost::lexical_cast<> for
now. Therefore, I reverted the corresponding changes in nvm.mandatory-cxx11.

Regards

Markus Wanner



_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel

signature.asc (250 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: mandatory-cxx11 on Cygwin doesn't have to_string

Stephen Leake-3
Markus Wanner <[hidden email]> writes:

>> searching for "to_string" in /usr/include turns up boost references
>> only.
>
> On Cygwin, the stdc++ headers live under /usr/lib/gcc/.

arrgghh.

> Bottom line: It looks like we're stuck with boost::lexical_cast<> for
> now. Therefore, I reverted the corresponding changes in
> nvm.mandatory-cxx11.

Ok.

--
-- Stephe

_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
Reply | Threaded
Open this post in threaded view
|

Re: mandatory-cxx11 on Cygwin doesn't have to_string

Markus Wanner-2
In reply to this post by Markus Wanner-2
On 05/20/2014 05:42 PM, Markus Wanner wrote:
> Yeah, I noticed these as well. Build animal porcupine (build 29) shows
> pretty much that same error. So does the alpaca (a NetBSD 6.1 box, see
> its build 25).

FWIW, that was with gcc-4.5. The build animal is now using gcc48 from
pkgsrc, which still shows that issue, but compiles the current head of
nvm.mandatory-cxx11 just fine (i.e. after the revert). (gcc-4.5 run into
other issues, so that version is not sufficient on NetBSD.)

Regards

Markus Wanner



_______________________________________________
Monotone-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/monotone-devel

signature.asc (250 bytes) Download Attachment