qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1655708] [NEW] target/ppc/int_helper.c:2806: strange expression ?
@ 2017-01-11 16:41 dcb
  2017-01-11 17:12 ` Eric Blake
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: dcb @ 2017-01-11 16:41 UTC (permalink / raw)
  To: qemu-devel

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;

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.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1655708

Title:
  target/ppc/int_helper.c:2806: strange expression ?

Status in QEMU:
  New

Bug description:
  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1655708/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-07-20 12:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-11 16:41 [Qemu-devel] [Bug 1655708] [NEW] target/ppc/int_helper.c:2806: strange expression ? dcb
2017-01-11 17:12 ` Eric Blake
2017-01-11 17:19   ` Thomas Huth
2017-01-11 18:01   ` joserz
2017-01-11 18:53 ` [Qemu-devel] [Bug 1655708] " Jose R. Ziviani
2017-01-11 20:09 ` dcb
2017-01-18 15:44 ` Thomas Huth
2017-07-20 12:44 ` Thomas Huth

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).