[cfe-dev] path sensitive vs context sensitive

Aleksei Sidorin via cfe-dev cfe-dev at lists.llvm.org
Fri Apr 28 06:47:20 PDT 2017


Hello Daniel,

CSA _is_ context-sensitive.

28.04.2017 16:09, Daniel Marjamäki via cfe-dev пишет:
> Hello!
>
> I believe that Clang has "path sensitive" analysis. I wonder why it is not technically "context sensitive"? Clang analyzes function calls.
>
> int div(int x) {
>    return 100/x; // <- warning: Division by zero
> }
>
> int main() {
>    div(0);   // <- change "0" to "10" and no warning is written.
>    return 0;
> }
>
> What criteria for "context sensitive" is it that clang does not fulfill?
>
> I have always claimed that Cppcheck has context sensitive analysis because it detects such bug. If that is wrong I'd like to know it, and why.
>
> Best regards,
> Daniel Marjamäki
>
> ..................................................................................................................
> Daniel Marjamäki Senior Engineer
> Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden
>
> Mobile:                 +46 (0)709 12 42 62
> E-mail:                 Daniel.Marjamaki at evidente.se
>
> www.evidente.se
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


-- 
Best regards,
Aleksei Sidorin,
SRR, Samsung Electronics




More information about the cfe-dev mailing list