All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH] tools/kdd: use mute -Warray-bounds only on new gcc version
Date: Sat, 7 Apr 2018 08:36:40 +0100	[thread overview]
Message-ID: <20180407073640.GA25704@deinos.phlegethon.org> (raw)
In-Reply-To: <20180406223915.GO3176@mail-itl>

At 00:39 +0200 on 07 Apr (1523061555), Marek Marczykowski-Górecki wrote:
> On Fri, Apr 06, 2018 at 06:12:50PM +0100, Wei Liu wrote:
> > On Fri, Apr 06, 2018 at 05:32:57PM +0200, Marek Marczykowski-Górecki wrote:
> > Oh thanks for the quick turnaround.
> > 
> > Since Tim thinks it is better to not disable the warning -- how about
> > using assert() to give the compiler a hint? Would that work?
> 
> No, it doesn't.
> 
> Changing offset type to uint32_t, or unsigned int works. Also adding
> "offset &= 0x2ff" helps (but changes behavior). And now I wonder if
> this warning isn't legitimate - maybe there is some int overflow case
> that I don't see?

Huh.  I don't see an overflow - if anything, having offset be 64bit
should make it safer.  But having offset be uint32_t should be fine
too, so if it makes gcc happy, that's fine.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-04-07  7:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05  1:50 [PATCH 0/7] Fix warnings found by gcc 8 Marek Marczykowski-Górecki
2018-04-05  1:50 ` [PATCH 1/7] tools/libxc: fix strncpy size Marek Marczykowski-Górecki
2018-04-05  1:50 ` [PATCH 2/7] tools/misc: fix hypothetical buffer overflow in xen-lowmemd Marek Marczykowski-Górecki
2018-04-05  1:50 ` [PATCH 3/7] tools/blktap2: fix hypothetical buffer overflow Marek Marczykowski-Górecki
2018-04-05  1:50 ` [PATCH 4/7] tools/blktap2: fix possible '\0' truncation Marek Marczykowski-Górecki
2018-04-05  1:50 ` [PATCH 5/7] tools/xenpmd: " Marek Marczykowski-Górecki
2018-04-05  1:50 ` [PATCH 6/7] tools/gdbsx: fix -Wstringop-truncation warning Marek Marczykowski-Górecki
2018-04-05  1:50 ` [PATCH 7/7] tools/kdd: mute spurious gcc warning Marek Marczykowski-Górecki
2018-04-06 12:39   ` Boris Ostrovsky
2018-04-06 13:07     ` Wei Liu
2018-04-06 13:39       ` Boris Ostrovsky
2018-04-06 13:41         ` Wei Liu
2018-04-06 13:56           ` Boris Ostrovsky
2018-04-06 14:32             ` Marek Marczykowski-Górecki
2018-04-06 15:12               ` Wei Liu
2018-04-06 15:32                 ` [PATCH] tools/kdd: use mute -Warray-bounds only on new gcc version Marek Marczykowski-Górecki
2018-04-06 17:12                   ` Wei Liu
2018-04-06 22:39                     ` Marek Marczykowski-Górecki
2018-04-07  7:36                       ` Tim Deegan [this message]
2018-04-06 17:03               ` [PATCH 7/7] tools/kdd: mute spurious gcc warning Tim Deegan
2018-04-05  9:03 ` [PATCH 0/7] Fix warnings found by gcc 8 Wei Liu
2018-04-05 12:49   ` Juergen Gross

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=20180407073640.GA25704@deinos.phlegethon.org \
    --to=tim@xen.org \
    --cc=ian.jackson@eu.citrix.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.