Skip to content

Conversation

@ldursw
Copy link

@ldursw ldursw commented Sep 9, 2025

When compiling with -O3 -Wall -Wextra a warning is emitted about a comparison always being true. sideset_bit_count is unsigned so it can't be negative. Just remove the comparison to fix the warning.

pico-sdk/src/rp2_common/hardware_pio/include/hardware/pio_instructions.h: In function 'uint pio_encode_sideset_opt(uint, uint)':
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);
      |                                       ~~~~~~~~~~~~~~~~~~^~~~

@lurch
Copy link
Contributor

lurch commented Sep 9, 2025

Duplicate of #2608 ?

@ldursw ldursw closed this Sep 9, 2025
@ldursw
Copy link
Author

ldursw commented Sep 9, 2025

Yes. It is the same as #2608. Closing this PR in favor of the older one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants