qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 2d3151: configure: Always compile with -fwrap


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 2d3151: configure: Always compile with -fwrapv
Date: Tue, 13 Sep 2016 09:00:08 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 2d31515bc0880a1cea86ce638d2a109f4f4e6f7d
      
https://github.com/qemu/qemu/commit/2d31515bc0880a1cea86ce638d2a109f4f4e6f7d
  Author: Peter Maydell <address@hidden>
  Date:   2016-09-13 (Tue, 13 Sep 2016)

  Changed paths:
    M configure

  Log Message:
  -----------
  configure: Always compile with -fwrapv

QEMU's code relies on left shifts of signed integers always
being defined behaviour with the obvious 2s-complement
semantics. The only way to tell the compiler (and any
associated undefined-behaviour sanitizer) that we require a
C dialect with these semantics is to use the -fwrapv option.
This is a bit of a heavy hammer for the job as it also gives
us guaranteed semantics on integer arithmetic overflow which
in theory we don't require.

In an ideal world this would allow us to drop the warning
flag -Wno-shift-negative-value, but we must retain this to
avoid spurious warnings on clang versions predating the
fix to https://llvm.org/bugs/show_bug.cgi?id=25552.

Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]