X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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 AT gmail DOT com In-Reply-To: References: <55fcf4b3-5fd0-8fa1-6669-5a93a14c863e AT t-online DOT de> <258a1db5-4151-33c7-5db6-2a06f82975c5 AT SystematicSw DOT ab DOT ca> From: Jeffrey Walton Date: Thu, 6 Sep 2018 10:06:57 -0400 Message-ID: Subject: Re: Why does -std=c++11 hide certain function calls To: cygwin AT cygwin DOT com Cc: Brian DOT Inglis AT systematicsw DOT ab DOT 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 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 . 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