delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/09/05/15:36:51

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:references:in-reply-to:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
q=dns; s=default; b=Zbs5mumNzaHyLXIhbZ51GfRteeQYCP+ADfKSomSZn62
wdDuxgGiJ7qP9GyriH0/wcd0WZLICanjYG+vlwuJqll/Mgw7H6mvd+L1B07sOsi7
v1ET1ASbYbrwYn8zj7WUTBblAlNC/oUfDDCArJltUNcH4+/BPh+mv3sb/vjcvFiY
=
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:references:in-reply-to:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
s=default; bh=xIaQlmTC3UGRqF5voBHuOxN3/pA=; b=vWpBcQA+VsKdbo0ve
uRpr/LPWLr/kQr2SO0x7t+HFSjw75LRZqxUD9UzzS62jNgdnb4EHot8+xzGcqlor
Px/CojaZhcIUfepOi/6yagVsbXCdFdl83uN944bQozOnAGSxYnB2HeEXHu2LStJl
DkenwJnsB8nGkUZ+CCO4CclqNs=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=networking, HBBroekertonlinede, libary, HBBroeker AT t-online DOT de
X-HELO: mail-wm0-f42.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=PrDx7Sa02416QbGbLo7ZZ3CqFvR8XVxT/MYIrFdIvJo=; b=e4if7YLfMKkeLzRmGaXqjS1DRR5IFNOE0mdNX5Y1DglyBq9nTkugA36i3joFVhiNw3 T1dmIFaUF6w4TB8DUzBcROXccYXFIKKHo4e4HReRP34ha0aqcKAqxfr4/oNwf9DLCjYA 0wFIHUpW1v/h8FxHFrcSDautSfQI27SiqHXmmZk8KnFB1IQzvHnJUX3XGWFJpf8f3M3Q 8lSbLeTaRAWJerQob7FdHGxwo1aIrR/cvpTaNxpRyHlOjkKsVhhALuafAzqCg8x3Pq2f A8FJIlLOGI5TlZZnhxYWyYIdYl+U8mK7G98DEU2h1o2uIsT201aP6pl6BG0TvnZpWOdJ 5IWA==
MIME-Version: 1.0
References: <CAJn6YFD-zJoH4wtDaRq1EYYLwzWv_EYFWLGm+quj_RobFMv2Dg AT mail DOT gmail DOT com> <55fcf4b3-5fd0-8fa1-6669-5a93a14c863e AT t-online DOT de>
In-Reply-To: <55fcf4b3-5fd0-8fa1-6669-5a93a14c863e@t-online.de>
From: John Selbie <jselbie AT gmail DOT com>
Date: Wed, 5 Sep 2018 12:36:25 -0700
Message-ID: <CAJn6YFD+RjY60kDZU7pQP7BHpdxCDGGwg+2yeOM7=XKVER_C1Q@mail.gmail.com>
Subject: Re: Why does -std=c++11 hide certain function calls
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id w85JaoZR027027

Thanks for the response.

But why is getaddrinfo (and its associated struct types and flag values)
considered a "language extension" and hidden via the __POSIX_VISIBILE
define when other function declarations in netdb.h (such as getservbyname)
are not?

I don't believe C++ has any formal support for networking.  So it's
surprising to see one networking function hidden "because its an
extension", but the other very related functions are not. Can you elaborate
on the decision process that makes it this way?  I honestly don't see how a
header file qualifies as a language extension, but instead just see it as
the interface for a pre-compiled library.

Is it because modern C++ is defined to support older POSIX functions, but
not newer ones?  Where is that in the standard?

As I said before, I'm wanting to be educated on this, because it could
influence how I view the writing and building of portable code now and in
the future.  But saying, "everywhere else but here is wrong" and because ",
doesn't help.

jrs


On Wed, Sep 5, 2018 at 11:46 AM Hans-Bernhard Bröker <HBBroeker AT t-online DOT de>
wrote:

> Am 05.09.2018 um 07:55 schrieb John Selbie:
>
> > With this: g++ foo.cpp -c -std=c++11
> > It compiles fine everywhere else, except CygWin.  Output on Cygwin:
>
> I'm afraid that may mean everywhere else is wrong.
>
> > Yes, switching to -std=gnu++11 or adding  -D_DEFAULT_SOURCE to the
> command
> > line line works.
> >
> > But I don't understand why the need to enforce these extensions to get
> > access to some of the most common unix libraries?
>
> Because that's what std=c++11 is meant and documented to do.  It turns
> off all extensions to the standard language.  And yes, that does include
> extensions to the standard libary, up to and including POSIX-specific
> content.
>
> For what you want to do, std=c++11 is simply the wrong setting.
>
> --
> 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
>
>

--
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019