llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

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

Open llvmbot opened this issue 16 years ago • 3 comments

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 avatar Jun 24 '10 16:06 llvmbot

assigned to @tkremenek

llvmbot avatar Jun 24 '10 16:06 llvmbot

does not show since 4aa1590ad66a(https://github.com/llvm/llvm-project/pull/187530) due to bisection

hongtaihu avatar Oct 16 '26 04:10 hongtaihu

5. does not show since 4aa1590(#187530) due to bisection

This issue is before the GitHub migration, so it is hard to trace it back. In https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20100621/thread.html I went through all the PRs authored by Ted Kremenek since it got assigned to that person in this issue, but I could not find the exact fix for it. I was also looking for the 7482 Bugzilla link, but no success there neither. I think we can close this as not planned since we cannot reproduce it.

For the detailed discussion covering this issue you can visit my comment in the discussion thread on Discord: https://discord.com/channels/636084430946959380/1560968662943273062/1564402374926139602

benedekaibas avatar Oct 28 '26 20:10 benedekaibas