Quantcast

path sensitive vs context sensitive

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

path sensitive vs context sensitive

Lang Hames 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:                 [hidden email]

www.evidente.se
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: path sensitive vs context sensitive

Lang Hames via cfe-dev
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:                 [hidden email]
>
> www.evidente.se
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


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

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...