-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Milestone
Description
GCC 14.3 with pedantic -Wall -Wextra
warnings enabled produces the following warning on a comparison that's always true
because of the param being unsigned
home/runner/arduino_ide/hardware/pico/rp2040//pico-sdk/src/rp2_common/hardware_pio/include/hardware/pio_instructions.h: In function 'uint pio_encode_sideset_opt(uint, uint)':
/home/runner/arduino_ide/hardware/pico/rp2040//pico-sdk/src/rp2_common/hardware_pio/include/hardware/pio_instructions.h:151:57: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
151 | valid_params_if(PIO_INSTRUCTIONS, sideset_bit_count >= 0 && sideset_bit_count <= 4);
| ~~~~~~~~~~~~~~~~~~^~~~
/home/runner/arduino_ide/hardware/pico/rp2040//pico-sdk/src/rp2_common/hardware_pio/include/hardware/pio_instructions.h:151:5: note: in expansion of macro 'valid_params_if'
151 | valid_params_if(PIO_INSTRUCTIONS, sideset_bit_count >= 0 && sideset_bit_count <= 4);
| ^~~~~~~~~~~~~~~
pico-sdk/src/rp2_common/hardware_pio/include/hardware/pio_instructions.h
Lines 150 to 154 in a1438df
static inline uint pio_encode_sideset_opt(uint sideset_bit_count, uint value) { | |
valid_params_if(PIO_INSTRUCTIONS, sideset_bit_count >= 0 && sideset_bit_count <= 4); | |
valid_params_if(PIO_INSTRUCTIONS, value <= ((1u << sideset_bit_count) - 1)); | |
return 0x1000u | value << (12u - sideset_bit_count); | |
} |