public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Gcc Patch List <gcc-patches@gcc.gnu.org>,
	Jonathan Wakely <jwakely@redhat.com>,
	libstdc++ <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] detect incompatible aliases (PR c/81854)
Date: Mon, 18 Sep 2017 21:21:00 -0000	[thread overview]
Message-ID: <3b4c0fe1-9479-dd5c-341d-91a608bb76cc@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1709121613180.28643@digraph.polyomino.org.uk>

On 09/12/2017 10:17 AM, Joseph Myers wrote:
> On Thu, 17 Aug 2017, Martin Sebor wrote:
>
>> +		  || (prototype_p (t1)
>> +		      && prototype_p (t2)
>> +		      && !types_compatible_p (t1, t2))))
>
> Why the restriction to prototyped types?  I'd expect a warning for an
> alias between unprototyped functions of types int () and void (), for
> example.  Or for an alias between void () and void (char), as a function
> with a char argument is not compatible with a non-prototype function in C.
> Is this an issue with the problem being diagnosed at a point where the
> langhooks for language-specific type compatibility rules aren't available?
> If that's preventing diagnosing incompatibility involving unprototyped
> functions, then the patch is OK.

It's meant as an escape hatch.  It allows declaring compatibility
symbols, for example by the libstdc++ _GLIBCXX_3_4_SYMVER macro
defined in libstdc++-v3/src/c++98/compatibility.cc.  The macro is
used to declare compatibility functions of all sorts of incompatible
types.  The originally posted patch had libstdc++ disable the warning
for the file with the symbols but Jonathan preferred this solution.

It could perhaps be tightened up to detect some of the cases on your
list but I'm not sure it's worth the effort and added complexity.
Let me know if you feel differently (or have a different suggestion),
otherwise I will go ahead and commit the patch as is.

Thanks
Martin

  reply	other threads:[~2017-09-18 21:21 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
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 [this message]
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=3b4c0fe1-9479-dd5c-341d-91a608bb76cc@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.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).