Open llvmbot opened 13 years ago
Bug still present as of : $ clang --version clang version 10.0.1 (Red Hat 10.0.1-1.module+el8.3.0+7459+90c24896) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/bin
Steps to reproduce:
I just hit this bug with 3.7.0.
Clang 3.5.1 is still affected by this issue.
ping!
ping! :)
Can you provide:
(A) Self-contained source that exhibits the problem. (B) A preprocessed version of that source (so I see the definitions on your system).
Thanks!
I haven't had a chance to look at this yet.
Ping!
assigned to @tkremenek
Extended Description
clang-analyzer can't really deal with FD_SET and FD_ZERO. I think the problem is cause these macros are assembler code.
Code:
rc = select(maxfd, &localset, NULL, NULL, timeout);
...
FD_ZERO(&localset2); for (f = 0; f < maxfd; f++) { if (FD_ISSET(f, readfds) && FD_ISSET(f, &localset)) { FD_SET(f, &localset2); } }
http://test.libssh.org/clang-analyzer/
Result:
Within the expansion of the macro 'FD_SET': The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage.
Test code:
If you're looking for some test code see the EXAMPLE section in the select(2) manpage.