public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: GCC-6.4 sys/select.h build failures with std=c++14
Date: Tue, 26 Sep 2017 04:49:00 -0000	[thread overview]
Message-ID: <961f5079-1561-64c8-8b32-c74099755ef1@SystematicSw.ab.ca> (raw)
In-Reply-To: <CAHBhQykTn7Y2rPVtAQSaVu+1J8ytSDAAcT-Su5e_oABEVNmtrA@mail.gmail.com>

On 2017-09-25 19:41, Ian Fette wrote:
> I tried compiling a very simple program with curl using -std=c++14 under 
> 64-bit cygwin with gcc 6.4.0. When compiling with just g++ main.cpp -lcurl 
> everything is fine, however if I try to use c++14 as the dialect (g++ 
> main.cpp -lcurl -std=c++14) familiar problems creep up

> This is resolved by manually including <sys/select.h> before including 
> <curl/curl.h>

> This was discussed in the curl project in the past 
> (https://github.com/curl/curl/issues/749) where it was determined that it was
> caused by a cygwin bug which was addressed in 
> https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/sys/types.h;
> h=c9f0fc7f3a9ca420c2372c9af42ce2a0e63e3b1c;hb=ee97c4b22491b205fd3b7697e03c909e02b652d3
> If anyone has thoughts, I'd greatly appreciate it.

A lot of GNU and Cygwin package build problems are avoided by building either
without any -std=... option, or equivalently with -std=gnu++nn, which enables
many non-portable GCC extensions and Unix features, instead of -std=c++nn, which
disables GCC extensions and Unix features, and accepts only portable features
supported by GCC and C++ headers you specify.

In general, try replacing -std=c... with -std=gnu... or omitting -std=... and
see if your program builds without errors or warnings.
Adding -Wall -Wextra will let you know if anything appears questionable to the
compiler.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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

  reply	other threads:[~2017-09-26  4:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26  1:41 Ian Fette
2017-09-26  4:49 ` Brian Inglis [this message]
2017-09-26  5:33 ` Marco Atzeri
2017-09-26 19:33   ` Hans-Bernhard Bröker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=961f5079-1561-64c8-8b32-c74099755ef1@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).