linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] tracing: silence GCC 9 array bounds warning
Date: Fri, 17 May 2019 20:45:07 +0200	[thread overview]
Message-ID: <CANiq72=Wr-u1S8bxV07zPSV8vaXGVqYkTULKQADXfXXEZ0cmxQ@mail.gmail.com> (raw)
In-Reply-To: <20190517124715.3d82bdbe@oasis.local.home>

Hi Steven,

On Fri, May 17, 2019 at 6:47 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> Hi Miguel,
>
> Linus mentioned this too.
>
>  https://lore.kernel.org/lkml/CAHk-=wihYB8w__YQjgYjYZsVniu5CtkTcFycmCGdqVg8GUje7g@mail.gmail.com/T/#u

Ah, I didn't see that. We were discussing here [1] backporting to 4.19
some cleanups we did for GCC 9 a few months ago, so I was testing that
Linus' master was still clean a few hours ago. When I found that
couple of warnings I quickly made a patch before I forgot. I should
probably have added RFC :-)

[1] https://lore.kernel.org/lkml/CANiq72=fsL5m2_e+bNovFCHy3=YVf53EKGtGE_sWvsAD=ONHuQ@mail.gmail.com/

> Setting the LAT_FMT isn't something a function called "reset" should do.

I added the surrounding code heuristically since it was in a single
block with the comment above and since it was repeated in both places,
but I had no idea on the semantics. :-)

> > +     memset((char *)(iter) + offsetof(struct trace_iterator,
>
> Why (char *)? Please use (void *).

We are adding a byte-sized offset, so char * is the one that makes
sense. Doing it with void * works, although it is a GNU extension. But
as you prefer :-)

Cheers,
Miguel

  reply	other threads:[~2019-05-17 18:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17  9:25 [PATCH] tracing: silence GCC 9 array bounds warning Miguel Ojeda
2019-05-17 16:47 ` Steven Rostedt
2019-05-17 18:45   ` Miguel Ojeda [this message]
2019-05-17 17:59 ` Linus Torvalds
2019-05-17 19:09   ` Miguel Ojeda
2019-05-19 21:35     ` Steven Rostedt
2019-05-17 20:54 ` Miguel Ojeda
2019-05-23 12:45 Miguel Ojeda
2019-05-24  2:12 ` Steven Rostedt
2019-05-24  4:05   ` Miguel Ojeda
2019-05-24 11:52     ` Steven Rostedt

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='CANiq72=Wr-u1S8bxV07zPSV8vaXGVqYkTULKQADXfXXEZ0cmxQ@mail.gmail.com' \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.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 NNTP newsgroup(s).