public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>
Cc: Martin Sebor <msebor@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
		Joseph Myers <joseph@codesourcery.com>,
	Jeff Law <law@redhat.com>, 	Richard Biener <rguenther@suse.de>,
	Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH] Implement a warning for bogus sizeof(pointer) / sizeof(pointer[0])
Date: Mon, 01 May 2017 15:54:00 -0000	[thread overview]
Message-ID: <CADzB+2nAEoFxUNjJNd0_hZWuvc2YL=CvJgLZLNNH9dJ=WTkxEw@mail.gmail.com> (raw)
In-Reply-To: <AM4PR0701MB216244DC6B64C2EA6C282103E4130@AM4PR0701MB2162.eurprd07.prod.outlook.com>

On Fri, Apr 28, 2017 at 1:05 PM, Bernd Edlinger
<bernd.edlinger@hotmail.de> wrote:
> On 04/28/17 17:29, Martin Sebor wrote:
>> On 04/28/2017 08:12 AM, Bernd Edlinger wrote:
>>>
>>> Do you want me to change the %qT format strings to %T ?
>>
>> Yes, with the surrounding %< and %> the nested directives should
>> use the unquoted forms, otherwise the printer would end up quoting
>> both the whole expression and the type operand.
>>
>> FWIW, to help avoid this mistake, I think this might be something
>> for GCC -Wformat to warn on and the pretty-printer to detect (and
>> ICE on).
>>
>
> Ah, now I understand.  That's pretty advanced.
>
> Here is the modified patch with correct quoting of the expression.
>
> Bootstrap and reg-testing on x86_64-pc-linux-gnu.

> * cp-gimplify.c (cp_fold): Implement the -Wsizeof_pointer_div warning.

I think this warning belongs in cp_build_binary_op rather than cp_fold.

Jason

  reply	other threads:[~2017-05-01 15:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 21:33 Bernd Edlinger
2017-04-22  6:51 ` Martin Sebor
2017-04-22 17:50   ` Bernd Edlinger
2017-04-28  3:23     ` Martin Sebor
2017-04-28 14:42       ` Bernd Edlinger
2017-04-28 16:27         ` Martin Sebor
2017-04-28 17:20           ` Bernd Edlinger
2017-05-01 15:54             ` Jason Merrill [this message]
2017-05-02 13:38               ` Bernd Edlinger
2017-05-03 13:15                 ` Jason Merrill
2017-05-12 16:56                   ` [PING] " Bernd Edlinger
2017-06-01 16:03                     ` [PING**2] " Bernd Edlinger
2017-06-01 22:09                       ` Joseph Myers

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='CADzB+2nAEoFxUNjJNd0_hZWuvc2YL=CvJgLZLNNH9dJ=WTkxEw@mail.gmail.com' \
    --to=jason@redhat.com \
    --cc=bernd.edlinger@hotmail.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=law@redhat.com \
    --cc=msebor@gmail.com \
    --cc=rguenther@suse.de \
    /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).