From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Patch Tracking <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings
Date: Fri, 06 Feb 2015 09:30:02 -0800 [thread overview]
Message-ID: <54D4FA1A.20104@twiddle.net> (raw)
In-Reply-To: <CAFEAcA-5hqOYtqC7CiGebevfN+kOtP8gPY96ur+OFP5hPoBmOQ@mail.gmail.com>
On 02/06/2015 08:43 AM, Peter Maydell wrote:
> On 6 February 2015 at 16:20, Richard Henderson <rth@twiddle.net> wrote:
>> It should be enough to simply add the unsigned suffix to the integers as they
>> are, forcing the underlying type to be unsigned.
>
> I can't see anything in the C99 spec that justifies this
> as a fix... In fact, 6.7.2.2 para 3 says
> "The identifiers in an enumerator list are declared as
> constants that have type int", which sounds to me like it
> means "if you have enum { foo = ..., }; then 'foo' must
> have (signed) integer type even if the representation
> of the enum type is unsigned".
Hum. True, despite the talk in para 4 about the compatible type of the
enumeration. Which is why my test worked with a variable of enum type, but
doesn't work with one of the enum members.
Oh well.
r~
next prev parent reply other threads:[~2015-02-06 17:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 14:34 [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings Peter Maydell
2015-02-06 14:34 ` [Qemu-devel] [PATCH 1/4] target-arm: A64: Fix shifts into sign bit Peter Maydell
2015-02-13 3:07 ` Greg Bellows
2015-02-06 14:34 ` [Qemu-devel] [PATCH 2/4] target-arm: A64: Fix handling of rotate in logic_imm_decode_wmask Peter Maydell
2015-02-06 14:34 ` [Qemu-devel] [PATCH 3/4] target-arm: A64: Avoid left shifting negative integers in disas_pc_rel_addr Peter Maydell
2015-02-06 14:34 ` [Qemu-devel] [PATCH 4/4] target-arm: A64: Avoid signed shifts in disas_ldst_pair() Peter Maydell
2015-02-06 15:57 ` [Qemu-devel] [PATCH 0/4] target-arm: fix various clang UB sanitizer warnings Greg Bellows
2015-02-06 16:09 ` Richard Henderson
2015-02-06 16:20 ` Richard Henderson
2015-02-06 16:43 ` Peter Maydell
2015-02-06 17:30 ` Richard Henderson [this message]
2015-02-06 17:37 ` Eric Blake
2015-02-06 17:48 ` Peter Maydell
2015-02-09 9:16 ` Markus Armbruster
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=54D4FA1A.20104@twiddle.net \
--to=rth@twiddle.net \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).