llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.97k stars 11.94k forks source link

False positive in idiom used in (for example) git source #7854

Open llvmbot opened 14 years ago

llvmbot commented 14 years ago
Bugzilla Link 7482
Version trunk
OS Linux
Attachments Simple example of the kind of thing used a lot in git
Reporter LLVM Bugzilla Contributor

Extended Description

I think this is used to avoid warnings from less sophisticated analysis. It seems to be used quite a bit in the git source, anyway. In the attached file the warning ought to be on the condition, since there the code clearly is using garbage/undefined values.

However, clang warns on the declaration/initialisation, and I think it should not. In this specific case I think the initialisation should just be ignored.

llvmbot commented 14 years ago

assigned to @tkremenek