public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Yaakov Selkowitz <yselkowitz@cygwin.com>
To: newlib@sourceware.org
Subject: Re: C++ and feature guards Warning Question
Date: Thu, 06 Apr 2017 05:26:00 -0000	[thread overview]
Message-ID: <b6b05000-2787-41b7-7e52-0a74a44ca068@cygwin.com> (raw)
In-Reply-To: <ec0af940-6d74-30a4-0e8d-c81ffe449e99@oarcorp.com>

On 2017-04-05 16:18, Joel Sherrill wrote:
> Trying to compile an open source package for RTEMS, I
> came across something I need help to figure out how
> best to address. The package is in C++ and giving a
> lot of warnings on methods which I would have thought
> are prototyped. But clearly the compiler settings
> are tripping the guards different than the package
> authors expect.
>
> Native GCC on CentOS 7 with glibc gives no warnings.

G++ defines _GNU_SOURCE on glibc targets, meaning that -std=c++NN is, 
contrary to the documentation, *not* strict ISO C++:

https://github.com/gcc-mirror/gcc/blob/master/gcc/config/gnu-user.h#L105

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51749

Per my comments in that BZ, I believe there is a better way of doing 
this, but it will require patches to both gcc and glibc.  Once this is 
done -- and while it's on my wishlist, I don't know when I'll have time 
to work on it -- software will finally stop taking -std=c++NN for 
granted.  In the meantime, building for newlib/Cygwin/RTEMS is going to 
be different from glibc in some cases.

In any case, the fix is either to use proper feature test macros, or use 
-std=gnu++NN instead.  I have had to do this on a number of occasions 
while building software for Cygwin.

-- 
Yaakov

  parent reply	other threads:[~2017-04-06  5:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 21:18 Joel Sherrill
2017-04-05 23:39 ` Chris Johns
2017-04-06  5:26 ` Yaakov Selkowitz [this message]
2017-04-07 16:51   ` Joel Sherrill
2017-04-07 21:22 ` Jeffrey Walton

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=b6b05000-2787-41b7-7e52-0a74a44ca068@cygwin.com \
    --to=yselkowitz@cygwin.com \
    --cc=newlib@sourceware.org \
    /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).