lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 18 Oct 2018 12:10:28 +0200
From:   Philipp K <philipp97kl@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     kernelnewbies@...nelnewbies.org, linux-kernel@...r.kernel.org,
        perex@...ex.cz, tiwai@...e.com,
        Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: [RFC: sound/i2c/cs8427] clang warns about cast to signed char

Hi,

I tried compiling the cs8247 sound module with clang and hit the
following warning:

sound/i2c/cs8427.c:141:31: warning: implicit conversion from 'int' to
'char' changes value from 160 to -96 [-Wconstant-conversion]
        data[0] = CS8427_REG_AUTOINC | CS8427_REG_CORU_DATABUF;
                ~ ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

data is a char array, and CS8427_REG_AUTOINC is defined as 0x80 (dec
128) which is too big for a (signed) char.

Looking at other code in the same file, we usually use unsigned chars.

So is there a reason for data being signed in this case? Otherwise we
could just change data to unsigned char and be on the safe side.

If you want I can send in a patch.

Regards,
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ