From: Eric Blake <eblake@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
"open list:Block layer core" <qemu-block@nongnu.org>,
quintela@redhat.com, crosthwaite.peter@gmail.com,
dgilbert@redhat.com, f4bug@amsat.org, kraxel@redhat.com,
dirty.ice.hu@gmail.com, pbonzini@redhat.com,
Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH v3] osdep: Make MIN/MAX evaluate arguments only once
Date: Wed, 3 Jun 2020 10:33:16 -0500 [thread overview]
Message-ID: <3eabc6a8-159f-5a01-0ec7-90cda9520a6f@redhat.com> (raw)
In-Reply-To: <ecef14ce-47ca-749e-25b4-8e3ee378bd34@redhat.com>
On 6/2/20 9:29 PM, Eric Blake wrote:
>>> +++ b/accel/tcg/translate-all.c
>>> @@ -2565,9 +2565,9 @@ int page_check_range(target_ulong start,
>>> target_ulong len, int flags)
>>> /* This function should never be called with addresses outside the
>>> guest address space. If this assert fires, it probably
>>> indicates
>>> a missing call to h2g_valid. */
>>> -#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS
>>> - assert(start < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
>>> -#endif
>>> + if (TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS) {
>>> + assert(start < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
>>> + }
>>
>> IIRC the ifdef is required for clang warnings vs the shift.
>> Have you tested that?
>
> I have not yet tested with clang. We'll see if the CLI bots get to that
> before I do... But if clang isn't happy, I may have to introduce yet a
> third macro, MIN_PP, safe for use in preprocessor statements.
I've now run a clang build over the entire tree (using clang 10.0.0 from
Fedora 32, which required other pending patches mentioned on the list to
work around unrelated warnings), the entire tree built without issue.
So at least one version of clang compiled my rewrite of this hunk just
fine, although it does not rule out what older versions might do.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-06-03 15:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 1:36 [PATCH v3] osdep: Make MIN/MAX evaluate arguments only once Eric Blake
2020-06-03 2:07 ` Richard Henderson
2020-06-03 2:29 ` Eric Blake
2020-06-03 15:33 ` Eric Blake [this message]
2020-06-03 16:32 ` Richard Henderson
2020-06-03 19:26 ` Eric Blake
2020-06-04 18:39 ` Paolo Bonzini
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=3eabc6a8-159f-5a01-0ec7-90cda9520a6f@redhat.com \
--to=eblake@redhat.com \
--cc=crosthwaite.peter@gmail.com \
--cc=dgilbert@redhat.com \
--cc=dirty.ice.hu@gmail.com \
--cc=f4bug@amsat.org \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richard.henderson@linaro.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).