From: Jason Merrill <jason@redhat.com>
To: David Malcolm <dmalcolm@redhat.com>,
Joseph Myers <joseph@codesourcery.com>,
law@redhat.com
Cc: Martin Sebor <msebor@gmail.com>,
Eric Gallager <egall@gwmail.gwu.edu>,
gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] v4: C/C++: add fix-it hints for missing '&' and '*' (PR c++/87850)
Date: Sat, 01 Dec 2018 18:38:00 -0000 [thread overview]
Message-ID: <bfd109f7-fd46-2e18-c6d7-179f4907af61@redhat.com> (raw)
In-Reply-To: <1543621685-20785-1-git-send-email-dmalcolm@redhat.com>
On 11/30/18 6:48 PM, David Malcolm wrote:
> On Tue, 2018-11-20 at 22:23 +0000, Joseph Myers wrote:
>> On Tue, 20 Nov 2018, David Malcolm wrote:
>>
>>> Should I do:
>>
>> You should do whatever is appropriate for the warning in question. But if
>> what's appropriate for the warning in question includes types that are
>> compatible but not the same, the comments need to avoid saying it's about
>> the types being the same.
> Thanks.
>
> Here's an updated version of the patch. I added a new
> compatible_types_for_indirection_note_p
> specifically for use by maybe_emit_indirection_note, and provided
> implementations for C and C++.
> +/* C implementation of compatible_types_for_indirection_note_p. */
> +
> +bool
> +compatible_types_for_indirection_note_p (tree type1, tree type2)
> +{
> + return comptypes (type1, type2) == 1;
> +}
Hmm, it looks like the C front-end comptypes will return 1 for e.g. enum
and int. It seems to me that what you want for this warning is actually
to check for the same type. Perhaps you want to use
comptypes_check_different_types? Joseph would know better what's
correct for the C front-end.
Jason
next prev parent reply other threads:[~2018-12-01 18:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-09 22:36 [PATCH] " David Malcolm
2018-11-10 7:01 ` Eric Gallager
2018-11-11 18:01 ` Martin Sebor
2018-11-11 21:02 ` David Malcolm
2018-11-12 21:32 ` Martin Sebor
2018-11-13 21:34 ` Jason Merrill
2018-11-15 21:48 ` [PATCH] v2: " David Malcolm
2018-11-16 18:13 ` Jason Merrill
2018-11-19 21:23 ` [PATCH] v3: " David Malcolm
2018-11-20 2:46 ` Joseph Myers
2018-11-20 22:05 ` David Malcolm
2018-11-20 22:23 ` Joseph Myers
2018-11-30 23:01 ` [PATCH] v4: " David Malcolm
2018-12-01 18:38 ` Jason Merrill [this message]
2018-12-03 22:14 ` Joseph Myers
2018-12-05 16:03 ` Jason Merrill
2018-12-05 16:18 ` David Malcolm
2018-11-21 0:36 ` [PATCH] v3: " Jeff Law
2018-11-21 0:39 ` Martin Sebor
2018-11-30 15:27 ` David Malcolm
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=bfd109f7-fd46-2e18-c6d7-179f4907af61@redhat.com \
--to=jason@redhat.com \
--cc=dmalcolm@redhat.com \
--cc=egall@gwmail.gwu.edu \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=law@redhat.com \
--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).