Unsigned int comparison to 0
- Dominant language
- C
- Stars
- 2.8k
- Forks
- 1.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 1
Description
The following comparisons are evaluating an unsigned integer with 0, which will always evaluate to true, possibly masking a bug.
https://github.com/ARMmbed/DAPLink/blob/06fa0a9ca76a0f4b2732b030ebbcba9e6e20a708/source/daplink/flash_hal.c#L50
https://github.com/ARMmbed/DAPLink/blob/06fa0a9ca76a0f4b2732b030ebbcba9e6e20a708/source/daplink/flash_hal.c#L51
https://github.com/ARMmbed/DAPLink/blob/06fa0a9ca76a0f4b2732b030ebbcba9e6e20a708/source/board/lpc55s69_bl.c#L91
https://github.com/ARMmbed/DAPLink/blob/06fa0a9ca76a0f4b2732b030ebbcba9e6e20a708/source/hic_hal/nxp/lpc55xx/hic_init.c#L230
Contributor guide
Research direction
Inspect the four linked comparisons in source/daplink/flash_hal.c, source/board/lpc55s69_bl.c, and source/hic_hal/nxp/lpc55xx/hic_init.c. Determine whether each unsigned-zero check is intended or masks a real error, then validate the affected firmware builds and confirm the warnings are resolved without changing valid behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100