Clang Analysis of glibc 2.13

Hi.

In case anyone is interested, I ran the clang analyzer on glibc 2.13.
The resulting report can be downloaded here :

http://sites.google.com/site/clanganalyzer/home/glibc-213

Regards,

John Smith

Hello,

In case anyone is interested, I ran the clang analyzer on glibc 2.13.
The resulting report can be downloaded here :

http://sites.google.com/site/clanganalyzer/home/glibc-213

Interesting. Luckily for getopt.c, the clang analyzer does not include a check for copied&pasted
code :wink:

Some of the reports seem to be false positives, though; e.g s_cosf.c:

66 complex float y;
67
68 real y = -imag x;
69 imag y = real x;
70
71 res = __ccoshf (y);
2 Function call argument is an uninitialized value

It seems that the clang analyzer does not understand glibc’s handling of complex numbers and thus
does not notice that “y” is initialized in lines 68f.

Jonathan

I was on the irc channel #llvm earlier, and some of the friendly folks
over there were kind enough to take a look the reports as well. They
too, concluded that there were quite a lot of false positives. Which
still sounds like 'good' results to me, as that means that the reports
can be used to improve the analyzer so it will create less false
positives in the future.
:slight_smile:

Thanks for taking a look,

John Smith.

While the analyzer doesn’t explicitly reason about complex numbers yet, it shouldn’t issue a warning here either. Can you file a bugzilla report with a self-contained test case?

Nevermind; I should be able to reproduce this fairly easily. Thanks for the data!