From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63208 invoked by alias); 6 Sep 2018 14:07:01 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 63195 invoked by uid 89); 6 Sep 2018 14:07:01 -0000 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 Received: from mail-oi0-f51.google.com (HELO mail-oi0-f51.google.com) (209.85.218.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Sep 2018 14:06:59 +0000 Received: by mail-oi0-f51.google.com with SMTP id b15-v6so20661975oib.10 for ; Thu, 06 Sep 2018 07:06:59 -0700 (PDT) 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 Received: by 2002:a4a:2a58:0:0:0:0:0 with HTTP; Thu, 6 Sep 2018 07:06:57 -0700 (PDT) Reply-To: noloader@gmail.com In-Reply-To: References: <55fcf4b3-5fd0-8fa1-6669-5a93a14c863e@t-online.de> <258a1db5-4151-33c7-5db6-2a06f82975c5@SystematicSw.ab.ca> From: Jeffrey Walton Date: Thu, 06 Sep 2018 14:07:00 -0000 Message-ID: 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" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00119.txt.bz2 On Thu, Sep 6, 2018 at 2:45 AM, John Selbie 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=3Dc* without any special language or library featu= res, > in which case you may also want to add -pedantic or more restrictive > options. > > Ahhhh=E2=80=A6. 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 . By default GCC uses a -std=3Dgnu++NN, not -std=3Dc++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