X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:reply-to:in-reply-to:references
	:from:date:message-id:subject:to:cc:content-type
	:content-transfer-encoding; q=dns; s=default; b=u73xUYQAl82PacS2
	8gtiQyfkc70ODHZk5IPN9kFDYT66jcrEPs+v2Ecv96a/We281wPytIhVvQHA8bD9
	SG/uuAsksh6e49++Ga07a2jqdBE06JLFKTpJGmyD/VY2l5aR2jn69f+l0kapy38B
	L1XCzkIJstbfsh9j3Ufje8ghiTA=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:reply-to:in-reply-to:references
	:from:date:message-id:subject:to:cc:content-type
	:content-transfer-encoding; s=default; bh=nYl+OCzhtMR8LQ3skQyh9G
	yGMkU=; b=jNU7y+6Nc95MyjXU+v3P0fdz+NXuhQrP2g4nuwCDrk5rZ5+k5KKtzp
	BXHom7hGpcnNzI0zwpDIZUiX3CvkIxO5NA91h30/d0RuzxWQUp9O5LP4tfR/Ptar
	uMvcvP4xWwtq9jUPe8GYoHHcTrDzgwdQGacuxAobG+3ETBiVLJx5g=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=
X-HELO: mail-oi0-f51.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20161025;        h=mime-version:reply-to:in-reply-to:references:from:date:message-id         :subject:to:cc:content-transfer-encoding;        bh=N9/OouCvjCv/f3kz0AaTTnoAq25kjW4ZsmFSs6EK1M0=;        b=WIA0wRQNb+w4D13qlZlQK4Rv8cAJExqLnqniXZGWRHRq8fd+swVTS5/rANQam80a4o         JJxjLXqDbmuW6tyt87AJREGzseuvBfJ/4xZYof8tVvZQay5TQ95isfIgLkzn69HjJfFy         9FX/xTlaIFgNR3c/IUfBmGFlVkqPONugzj42iFIkZql3AXHIWzuJ3ECLbprxYYCOX37f         EESoTC4SOO+020zPUD5V5wwR6rpu7HaCZ9cwkOzWYH5ZAtYfHUUOZSopTp8OzdT73L8y         FzSks/g+zERCOADWSBCmp/UE9+zjBZ7huDJooJckRIF8WZ6qvH9O8JNtjYI16sl/8PZq         GYNA==
MIME-Version: 1.0
Reply-To: noloader@gmail.com
In-Reply-To: <CAJn6YFDfNZdr=r+MbNQcRsPyEf8K0-=SXN13Qt5p-m9t=u24Bw@mail.gmail.com>
References: <CAJn6YFD-zJoH4wtDaRq1EYYLwzWv_EYFWLGm+quj_RobFMv2Dg@mail.gmail.com> <55fcf4b3-5fd0-8fa1-6669-5a93a14c863e@t-online.de> <CAJn6YFD+RjY60kDZU7pQP7BHpdxCDGGwg+2yeOM7=XKVER_C1Q@mail.gmail.com> <258a1db5-4151-33c7-5db6-2a06f82975c5@SystematicSw.ab.ca> <CAJn6YFDfNZdr=r+MbNQcRsPyEf8K0-=SXN13Qt5p-m9t=u24Bw@mail.gmail.com>
From: Jeffrey Walton <noloader@gmail.com>
Date: Thu, 6 Sep 2018 10:06:57 -0400
Message-ID: <CAH8yC8=rGUHcHEKx21rNu2SiwpH9inr7uWFe-fXdVkg+LSC7zA@mail.gmail.com>
Subject: Re: Why does -std=c++11 hide certain function calls
To: cygwin@cygwin.com
Cc: Brian.Inglis@systematicsw.ab.ca
Content-Type: text/plain; charset="UTF-8"
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id w86E7BZq015671

On Thu, Sep 6, 2018 at 2:45 AM, John Selbie <jselbie@gmail.com> wrote:
>> For Unixy builds, just don't specify -std. Only specify -std if you want
> to ensure that builds will work with earlier standards, compilers, or
> libraries, or for -std=c* without any special language or library features,
> in which case you may also want to add -pedantic or more restrictive
> options.
>
> Ahhhh…. that was my mistake.  I had erroneously assumed that not specifying
> -std would result in the oldest version of C++.  A quick check:
>
>     $ g++ foo.cpp -c -dM -E  | grep cplus
>     #define __cplusplus 201402L
>
> I was compiling with C++ 14 the whole time.  And it appears that when -std
> is used, the GNU defines are taken out, which ultimately influence how
> POSIX_VISIBLE Is defined within <features.h>.

By default GCC uses a -std=gnu++NN, not -std=c++NN. So you are getting
mostly the latest C++ but it is GNU's flavor with non-standard things
like Variable Length Arrays (VLA's).

> I'm not sure if I agree that -std should hide the functions from unix
> headers. (tldr: unix headers are explicitly outside the c++ standard, so
> the moment they are included, you might as well assume the developer wants
> it all...)

Cygwin and Newlib conflate options in unexpected ways.

I think they are making incorrect leaps about options. For example if
you want Posix you may not want a GCC extension like VLA's. I doubt it
will change, though. You just have to work around it.

Jeff

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


