Skip to content

Commit

Permalink
cppcheck: Fix Shifting signed 32-bit value by 31 bits is implementati…
Browse files Browse the repository at this point in the history
…on-defined behaviour

cppcheck emits a warning:
`Shifting signed 32-bit value by 31 bits is implementation-defined behaviour`, which is correct.

=> Add U suffix to constant to fix the issue

Signed-off-by: Peter Huewe <Peter.Huewe@infineon.com>
  • Loading branch information
PeterHuewe authored and wxleong committed Jun 8, 2022
1 parent 8c91c1f commit 3d55476
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eltt2.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ static int print_capability_flags(uint8_t *response_buf, uint8_t cap_selector)
tmp = ((propertyValue & (1<<2)) == 0? 0:1); // Check bit 2 value.
printf("Eh Enable: %i %s", (tmp), ((tmp)? "SET\n" : "CLEAR\n"));
//bit 30:3 = reserved
tmp = ((propertyValue & (1<<31)) == 0? 0:1); // Check bit 31 value.
tmp = ((propertyValue & (1U<<31)) == 0? 0:1); // Check bit 31 value.
printf("Orderly: %i %s", (tmp), ((tmp)? "SET\n" : "CLEAR\n"));
break;
default:
Expand Down

0 comments on commit 3d55476

Please sign in to comment.