All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: John Haxby <john.haxby@oracle.com>, xen-devel@lists.xen.org
Subject: Re: [PATCH 1/2] xen-detect: fix strict-aliasing compilation warning.
Date: Wed, 3 Dec 2014 15:51:43 +0000	[thread overview]
Message-ID: <547F318F.60002@citrix.com> (raw)
In-Reply-To: <547F2EA2.5030702@oracle.com>

On 03/12/14 15:39, John Haxby wrote:
> On 01/12/14 17:15, Andrew Cooper wrote:
>> On 01/12/14 14:37, John Haxby wrote:
>>> With gcc 4.8.3, compiling xen-detect gives a compilation warning if
>>> you're optimising:
>>>
>>> $ cc -Wall -Os xen-detect.c
>>> xen-detect.c: In function ‘check_for_xen’:
>>> xen-detect.c:65:9: warning: dereferencing type-punned pointer will break
>>> strict-aliasing rules [-Wstrict-aliasing]
>>>          *(uint32_t *)(signature + 0) = regs[1];
>>>          ^
>>>
>>> Signed-off-by: John Haxby <john.haxby@oracle.com>
>> Why are you compiling without the CFLAGS from the Xen build system?
>>
>> We explicitly disable strict alias optimisations, because optimisations
>> based upon the aliasing rules in C is mad.  Even when you eliminate all
>> the warnings, there are still subtle bugs because the compiler is free
>> to assume a lot more than a programmer would typically deem reasonable.
> Do you want me to repost the second patch (the actual bug fix one) so
> that it doesn't assume the line number changes and whatnot for this one?
>
> jch

With a pragmatic hat on, making more stuff "-Wall" safe is probably
better, although production code should use the surrounding infrastructure.

With all of these patches, you must CC the toolstack maintainers.  If
you believe it should make the cut for 4.5, you must also CC Konrad and
argue for a release ack.

~Andrew


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2014-12-03 15:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 14:37 Two miscellenous xen-detect patches John Haxby
2014-12-01 14:37 ` [PATCH 1/2] xen-detect: fix strict-aliasing compilation warning John Haxby
2014-12-01 17:15   ` Andrew Cooper
2014-12-01 18:45     ` John Haxby
2014-12-03 15:44       ` Andrew Cooper
2014-12-03 15:39     ` John Haxby
2014-12-03 15:51       ` Andrew Cooper [this message]
2014-12-01 14:37 ` [PATCH 2/2] xen-detect: check for XEN_PV before XEN_HVM John Haxby
2014-12-03 16:00   ` Andrew Cooper

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=547F318F.60002@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=john.haxby@oracle.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.