Re: C++11

Markus Wanner <[email protected]>
Newsgroups gmane.comp.version-control.monotone.devel
Message-ID <[email protected]>
On 05/17/2014 05:08 PM, Stephen Leake wrote:
> "LeJacq, Jean Pierre" <[email protected]> writes:
>> Setting the language level to -std='c++11' enables strict ISO C++ library 
>> support

Hm.. sure? Other than Cygwin, I saw no platform failing. I think
__STRICT_ANSI__ is not defined on anything but Cygwin.

I don't think we ever enforced strict ansi compliance, before. So I just
tried to make Cygwin consistent with the other platforms by undefining
__STRICT_ANSI__.

>>   -D'_POSIX_SOURCE=1'
>>   -D'_POSIX_C_SOURCE=200809L'
>>   -D'_XOPEN_SOURCE=700'
>>   -D'_XOPEN_SOURCE_EXTENDED=1'

Cygwin still didn't compile. Neither with _POSIX_C_SOURCE=200809L nor
_XOPEN_SOURCE=700. But requires undefining __STRICT_ANSI__ to actually
define fdopen (see its stdio.h header file). (Even though we don't pass
the -ansi argument.)

>> GNU extensions can then be enabled using:
>>
>>   -D'_GNU_SOURCE=1'
> 
> Is there a separate include file for posix? That would be cleaner than
> messing with these macros.

We can put such things in src/base.hh or add to CXXFLAGS via the
configure script. I personally prefer the former, but we need to
consider that it has no effect on the embedded netxx sources. (Actually
an argument to get rid of those...)

Regards

Markus Wanner

_______________________________________________
Monotone-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
signature.asc (application/pgp-signature, 242 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEAREDAAYFAlN3odYACgkQsPwMloDjyo+9SACeMzXuZzUd+uHkxfveq4Uqm+dW
t4MAn0Cypa51z/QZJjjE8QVh4yGipO9F
=RwVN
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.