diff options
Diffstat (limited to 'results/classifier/zero-shot/108/other/1655708')
| -rw-r--r-- | results/classifier/zero-shot/108/other/1655708 | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/results/classifier/zero-shot/108/other/1655708 b/results/classifier/zero-shot/108/other/1655708 new file mode 100644 index 000000000..882762c03 --- /dev/null +++ b/results/classifier/zero-shot/108/other/1655708 @@ -0,0 +1,82 @@ +other: 0.855 +device: 0.812 +semantic: 0.811 +socket: 0.783 +PID: 0.745 +vnc: 0.741 +graphic: 0.661 +performance: 0.660 +boot: 0.654 +network: 0.587 +permissions: 0.583 +files: 0.555 +KVM: 0.520 +debug: 0.473 + +target/ppc/int_helper.c:2806: strange expression ? + +target/ppc/int_helper.c:2806:25: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context] + +Source code is + + zone_digit = (i * 2) ? b->u8[BCD_DIG_BYTE(i * 2)] >> 4 : zone_lead; + +Which I read as + + zone_digit = (i * 2) ? (b->u8[BCD_DIG_BYTE(i * 2)] >> 4) : zone_lead; + +so I think the compiler warning is for the i * 2 lhs of the ?. + +I am not sure what to suggest as a bugfix. + +On 01/11/2017 10:41 AM, dcb wrote: +> Public bug reported: +> +> target/ppc/int_helper.c:2806:25: warning: ‘*’ in boolean context, +> suggest ‘&&’ instead [-Wint-in-bool-context] +> +> Source code is +> +> zone_digit = (i * 2) ? b->u8[BCD_DIG_BYTE(i * 2)] >> 4 : +> zone_lead; + +Also, looking at BCD_DIG_BYTE(): + +#if defined(HOST_WORDS_BIGENDIAN) +#define BCD_DIG_BYTE(n) (15 - (n/2)) +#else +#define BCD_DIG_BYTE(n) (n/2) +#endif + +Oops. n is under-parenthesized, and will cause invalid expansions for +some expressions. Let's fix that as well. + + +> so I think the compiler warning is for the i * 2 lhs of the ?. + +Yes - the compiler is complaining that 'i * 2' can only be non-zero if +'i' was non-zero (given that the code occurs in a loop for i between 0 +and 16), so it is just as easy to write 'i ? ...' instead of the weirder +'(i * 2) ? ...'. + +-- +Eric Blake eblake redhat com +1-919-301-3266 +Libvirt virtualization library http://libvirt.org + + + +> so it is just as easy to write 'i ? ...' instead of the weirder +> '(i * 2) ? ...'. + +I suspect it is just possible that the i * 2 expression is a typo +for something else, perhaps i & 2 or i << 2 or i >> 2 or something else. + +I don't know the code so I am unable to offer better guidance. + + +Patch has been posted to the mailing list: +https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg02008.html + +Fix had been committed here: +http://git.qemu.org/?p=qemu.git;a=commitdiff;h=365206aeb3d0bb72043d + |