From: Jonathan Wakely <jwakely@redhat.com>
To: Martin Sebor <msebor@gmail.com>
Cc: Gcc Patch List <gcc-patches@gcc.gnu.org>,
Joseph Myers <joseph@codesourcery.com>,
libstdc++ <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] detect incompatible aliases (PR c/81854)
Date: Fri, 18 Aug 2017 13:57:00 -0000 [thread overview]
Message-ID: <20170818131046.GF4582@redhat.com> (raw)
In-Reply-To: <b8534b3c-9ffd-5a1c-d5e7-536548c9b742@gmail.com>
On 17/08/17 21:21 -0600, Martin Sebor wrote:
>Joseph, while looking into implementing enhancement your request
>pr81824 I noticed that GCC silently accepts incompatible alias
>declarations (pr81854) so as sort of a proof-concept for the
>former I enhanced the checking already done for other kinds of
>incompatibilities to also detect those mentioned in the latter
>bug. Attached is this patch, tested on x85_64-linux.
>
>Jonathan, the patch requires suppressing the warning in libstdc++
>compatibility symbol definitions in compatibility.cc. I couldn't
>find a way to do it without the suppression but I'd be happy to
>try again if you have an idea for how.
Doing it that way is fine, but ...
>diff --git a/libstdc++-v3/src/c++98/compatibility.cc b/libstdc++-v3/src/c++98/compatibility.cc
>index 381f4c4..5f56b9e 100644
>--- a/libstdc++-v3/src/c++98/compatibility.cc
>+++ b/libstdc++-v3/src/c++98/compatibility.cc
>@@ -213,6 +213,11 @@ _ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
> _ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv
> */
>
>+// Disable warning about declaring aliases between functions with
>+// incompatible types.
>+#pragma GCC diagnostic push
>+#pragma GCC diagnostic ignored "-Wattributes"
>+
Could this be moved closer to the point where it's needed?
It's not needed until after line 361, right?
> namespace std _GLIBCXX_VISIBILITY(default)
> {
> _GLIBCXX_BEGIN_NAMESPACE_VERSION
>@@ -509,6 +514,9 @@ _GLIBCXX_MATHL_WRAPPER1 (tan, GLIBCXX_3.4);
> #endif
> #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
>
>+// Restore disable -Wattributes
>+#pragma GCC diagnostic pop
>+
> #endif
>
> #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
>
next prev parent reply other threads:[~2017-08-18 13:10 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 8:10 Martin Sebor
2017-08-18 13:10 ` Joseph Myers
2017-08-18 13:57 ` Jonathan Wakely [this message]
2017-08-18 18:22 ` Martin Sebor
2017-08-18 18:37 ` Jonathan Wakely
2017-08-18 21:02 ` Martin Sebor
2017-09-02 22:50 ` [PING] " Martin Sebor
2017-09-12 16:17 ` Joseph Myers
2017-09-18 21:21 ` Martin Sebor
2017-09-18 21:44 ` Joseph Myers
2017-09-19 15:16 ` Martin Sebor
2017-09-20 15:37 ` Steve Ellcey
2017-09-20 16:17 ` Martin Sebor
2017-09-20 16:38 ` Steve Ellcey
2017-09-20 17:23 ` Steve Ellcey
2017-09-20 17:32 ` Martin Sebor
2017-09-20 17:45 ` Steve Ellcey
2017-09-20 18:05 ` Joseph Myers
2017-09-20 18:01 ` Joseph Myers
2017-09-20 18:08 ` Steve Ellcey
2017-09-20 18:14 ` Joseph Myers
2017-09-20 21:01 ` Joseph Myers
2017-09-20 21:32 ` Martin Sebor
2017-09-20 21:45 ` Joseph Myers
2017-10-02 19:49 ` Steve Ellcey
2017-10-02 19:53 ` Joseph Myers
2017-10-02 20:17 ` Martin Sebor
2017-10-03 21:41 ` Andreas Schwab
2017-10-03 23:43 ` Martin Sebor
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=20170818131046.GF4582@redhat.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=libstdc++@gcc.gnu.org \
--cc=msebor@gmail.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).