Skip to content
Commit a299895b authored by Thomas Huth's avatar Thomas Huth Committed by Paolo Bonzini
Browse files

Switch the order of the parameters in report() and report_xfail()



Commit c09c54c6 ("lib: use an argument which doesn't require
default argument promotion") fixed a warning that occurs with Clang,
but introduced a regression: If the "pass" parameter is a value
which has only set the condition bits in the upper 32 bits of a
64 bit value, the condition is now false since the value is truncated
to "unsigned int" so that the upper bits are simply discarded.

We fixed it by reverting the commit, but that of course also means
trouble with Clang again. We can not use "bool" if it is the last
parameter before the variable argument list. The proper fix is to
swap the parameters around and make the format string the last
parameter.

This patch (except the changes in lib/libcflat.h and lib/report.c
and some rebase conflicts along the way) has basically been created
with following coccinelle script (with some additional manual tweaking
of long and disabled lines afterwards):

@@
expression fmt;
expression pass;
expression list args;
@@
 report(
-fmt, pass
+pass, fmt
 , args);

@@
expression fmt;
expression pass;
expression list args;
@@
 report_xfail(
-fmt, xfail, pass
+xfail, pass, fmt
 , args);

Tested-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
Message-Id: <20191206113102.14914-1-thuth@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 78818bb5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment