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.ha...@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 via email to