On Thu, Sep 10, 2015 at 09:25:55PM +0200, Jean-Marc Lasgouttes wrote:
> Le 09/09/15 02:35, Enrico Forestieri a écrit :
> >commit 864a4db26bfa7ec05de936e9446d29bf8e58fc58
> >Author: Enrico Forestieri <for...@lyx.org>
> >Date:   Wed Sep 9 02:34:18 2015 +0200
> >
> >     On cygwin, use -std=gnu++11 instead of -std=c++11
> [...]
> >          AM_CXXFLAGS="$AM_CXXFLAGS -std=c++11 -Wno-deprecated-register";;
> >        *)
> >-        AM_CXXFLAGS="$AM_CXXFLAGS -std=c++11"
> >-        AS_CASE([$host], [*cygwin*], [AM_CXXFLAGS="$AM_CXXFLAGS 
> >-U__STRICT_ANSI__"]);;
> >+        AS_CASE([$host], [*cygwin*],
> >+                [AM_CXXFLAGS="$AM_CXXFLAGS -std=gnu++11"],
> >+                [AM_CXXFLAGS="$AM_CXXFLAGS -std=c++11"]);;
> 
> Can you give me some hints on why this is needed on cygwin and not
> elsewhere?

Because on cygwin a whole lot of posix functions are not declared when
using -std=c++11. This is due to the fact that the compiler defines
the macro __STRICT_ANSI__ and this is used in the system includes
for not declaring anything which is not standard ansi. This macro is
also defined on other platforms (I checked with linux and solaris) but
those posix functions are still declared. For example, solaris does
as follows:

#if defined(__EXTENSIONS__) || \
        (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
        defined(_XPG6)
extern int posix_openpt(int);
extern int setenv(const char *, const char *, int);
extern int unsetenv(const char *);
#endif

while cygwin merely does

#ifndef __STRICT_ANSI__
...
#endif

I think that cygwin is the straw man here but this is what we have.

> Is there something that we do wrong wrt plain C++11 standard?

I don't know.

> I can revert to gnu++11 globally, but it kind of makes me nervous,
> especially when there is no documentation on what this really does.

-- 
Enrico

Reply via email to