[cfe-dev] PR17558 - Question about Uninitialized Variables

Michel Morin mimomorin at gmail.com
Tue Jan 14 17:55:49 PST 2014


Thanks for looking into the PR, Michael.

Michael Bao wrote:
> I'm looking at this bug report here:
> http://llvm.org/bugs/show_bug.cgi?id=17558
[...]
> I've narrowed down the issue ClassifyRefs::VisitCastExpr.

I don't know the internals of clang, but I don't think the cast is essential.
For example, here is a test case without casting:

#include <iostream>

int main()
{
    int x;
    bool b = (&x == 0);

    std::cout << x << std::endl; // Missing "uninitialized" warning
    std::cout << b << std::endl;
}


P.S.
Richard, I'd like to say thank you for fixing PR16054 (Missing
"uninitialized" warning). Spotting such uninitialized bugs without
running static analyzer is very helpful in a C primer course.


Regards,
Michel



More information about the cfe-dev mailing list