RT-Thread / RT-Thread/rt-thread
[Bug] 无符号整形和负数进行判断是否相等
Open
Nobody has claimed this yet.
bug
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
RT-Thread Version
5.2.0
Hardware Type/Architectures
stm32f1
Develop Toolchain
Other
Describe the bug
rt-thread\components\drivers\ipc\condvar.c 第50行 if (timeout != RT_WAITING_FOREVER),timeout 为uint32_t类型,而RT_WAITING_FOREVER = -1,两者作判断,MDK报warning: #68-D: integer conversion resulted in a change of sign
Other additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect rt-thread/components/drivers/ipc/condvar.c at line 50 and locate the definition of RT_WAITING_FOREVER. Build the affected code with the reported MDK toolchain and verify that the unsigned timeout comparison no longer produces the sign-conversion warning while preserving the intended forever-timeout behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100