cortex_m: make bit fields in cortex_m unsigned.
authoriosabi <iosabi@protonmail.com>
Thu, 9 Apr 2020 16:23:34 +0000 (16:23 +0000)
committerTomas Vanek <vanekt@fbl.cz>
Tue, 12 May 2020 05:05:45 +0000 (06:05 +0100)
commitdadf46f618b9cb3baea8679a4f6364df66092aac
treee41ea98a86343f7d1ed2e116f436178c65531469
parentb604bc6c4ccaf81d61cd1c8a5e5c9f1b722e252e
cortex_m: make bit fields in cortex_m unsigned.

Expression like (0xffff << 16) evaluate to type int, which is not able
to hold that value, producing a warning when compiling with
-fsanitize=undefined. This patch makes most of the cortex_m constants
unsigned using the BIT() macro or appending "ul" when possible to fix
the undefined behavior warning.

Signed-off-by: iosabi <iosabi@protonmail.com>
Change-Id: I7af194305ef612d7a32e74eaf9f11dd85fa87f32
Reviewed-on: http://openocd.zylin.com/5583
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/cortex_m.c
src/target/cortex_m.h