RT-Thread / RT-Thread/rt-thread

[Bug] 无符号整形和负数进行判断是否相等

Open
#9,287 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.