[PATCH] D139114: [Clang][Sema] Enabled implicit conversion warning for CompoundAssignment operator.

Nathan Chancellor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 17 07:57:37 PST 2023


nathanchance added a comment.

> I’ll have to filter the warnings to see if there are any other instances with other operators that appear problematic.

I count a single warning that triggers for an arithmetic operator (which might be a bug):

  ../drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10067:14: warning: implicit conversion from 'int' to 's8' (aka 'signed char') changes value from 128 to -128 [-Wconstant-conversion]
                  cal_val -= 128;
                             ^~~

and a few that trigger for `|=` (but I think they are all false positives?):

  ../drivers/usb/gadget/udc/bdc/bdc_core.c:62:17: warning: implicit conversion from 'unsigned long' to 'u32' (aka 'unsigned int') changes value from 18446744071830503424 to 2415919104 [-Wconstant-conversion]
          temp |= BDC_COS|BDC_COP_STP;
                  ~~~~~~~^~~~~~~~~~~~
  
  ../drivers/net/wireless/realtek/rtlwifi/rtl8192ee/led.c:62:13: warning: implicit conversion from 'unsigned long' to 'u32' (aka 'unsigned int') changes value from 18446744073707454463 to 4292870143 [-Wconstant-conversion]
                  ledcfg |= ~BIT(21);
                            ^~~~~~~~
  
  ../drivers/net/ethernet/intel/igb/igb_main.c:1834:42: warning: implicit conversion from 'unsigned long' to 'u32' (aka 'unsigned int') changes value from 18446744073709486592 to 4294902272 [-Wconstant-conversion]
                  tqavctrl |= E1000_TQAVCTRL_DATATRANTIM |
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  
  ../drivers/iio/adc/imx7d_adc.c:243:10: warning: implicit conversion from 'unsigned long' to 'u32' (aka 'unsigned int') changes value from 18446744073172680704 to 3758096384 [-Wconstant-conversion]
          cfg1 |= (IMX7D_REG_ADC_CH_CFG1_CHANNEL_EN |
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139114/new/

https://reviews.llvm.org/D139114



More information about the cfe-commits mailing list