From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIie5-0004iD-CQ for qemu-devel@nongnu.org; Thu, 30 Jun 2016 16:33:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIie3-0002zF-Bv for qemu-devel@nongnu.org; Thu, 30 Jun 2016 16:33:08 -0400 Date: Thu, 30 Jun 2016 16:32:59 -0400 (EDT) From: Paolo Bonzini Message-ID: <1978695732.3315031.1467318779611.JavaMail.zimbra@redhat.com> In-Reply-To: <5b24e821-7b08-257b-0b3e-0e3336ee644c@redhat.com> References: <1467315396-3628-1-git-send-email-jsnow@redhat.com> <209727639.3312728.1467317746061.JavaMail.zimbra@redhat.com> <5b24e821-7b08-257b-0b3e-0e3336ee644c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Remove left shifts of negative signed integers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, kraxel@redhat.com, peter maydell > > GCC correctly puts this warning under -Wextra, and promises not to ever > > make use of this facet of undefined behavior. The only correct patch > > is the one that disables the warning for clang, and possibly adds > > -fwrapv. In GCC, -fwrapv correctly silences ubsan's left-shift > > and signed-overflow warnings. In Clang, this is reported at > > https://llvm.org/bugs/show_bug.cgi?id=25552. It's a heavy hammer > > but it's the safest options as compiler evolve. > > Where /exactly/ do you propose we canonicalize the clang invocation you > would like to support? In configure where we look for other warning flags. Add -fwrapv and -Wno-shift-negative-value so that they're enabled if the compilers supports them. Paolo