Frama-C-discuss mailing list archives
This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Frama-c-discuss] Frama-C: Detecting unreachable code?
- Subject: [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: pascal.cuoq at gmail.com (Pascal Cuoq)
- Date: Sat, 25 Jan 2014 20:55:32 +0100
- In-reply-to: <B517F47C2F6D914AA8121201F9EBEE6701C76682E22F@Mail1.FCMD.local>
- References: <B517F47C2F6D914AA8121201F9EBEE6701C7660449A7@Mail1.FCMD.local> <52E0C26F.2000605@linux-france.org> <20140123082550.GA7256@opentech.at> <CAOH62JhyfqOmKmw5iKjx1CSifK2X6ajxZBxd--h4_nK-3OxmrA@mail.gmail.com> <52E0D85C.3060504@cea.fr> <CAOH62Jj=TOozP8yxRV7-ECSUknpVhe6_eeMwPuQGOJTYJD+5fg@mail.gmail.com> <B517F47C2F6D914AA8121201F9EBEE6701C7660449A8@Mail1.FCMD.local> <0B8A5A42-5BB3-4C9C-99A6-A07AC39A84AB@cea.fr> <B517F47C2F6D914AA8121201F9EBEE6701C7660449A9@Mail1.FCMD.local> <20140125190009.351e083d@gavalla> <B517F47C2F6D914AA8121201F9EBEE6701C76682E22F@Mail1.FCMD.local>
On Sat, Jan 25, 2014 at 8:43 PM, Dharmalingam Ganesan < dganesan at fc-md.umd.edu> wrote: > Thanks, but replacing the ensures by \false still proves correct. > Which should tell you something. > The code is incorrect (comparing an unsigned int to < 0) but WP is not > pointing me this error. > The WP plug-in is designed for proving the functional correctness of a piece of C code: if such-and-such conditions are true of the state in which the code is invoked, then so-and-so conditions hold for the resulting state after the target code has been executed. In much the same way that all elements of the empty set are pink, for all memory sets satisfying i<0 that you can invoke your function in, the resulting state satisfies \result == -1 (and also satisfies \false). If you consider that comparing an expression of unsigned type to zero is ?incorrect?, and that is only *your* definition (the standard makes it clear what the result of this comparison is, and it's not undefined. In fact it is one of the better-defined operations), you could write your own plug-in that detects such comparisons. It is not the role of either Frama-C's value analysis or WP to detect such comparisons. Note that I am not saying that writing a Frama-C plug-in is easy, that the APIs are documented or that you are entitled to be helped for free in this endeavor. I am only saying that if your goal is to detect strange comparisons, the existing Value and WP plug-ins were not designed to be solutions to your problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20140125/e7301a40/attachment.html>
- References:
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: dganesan at fc-md.umd.edu (Dharmalingam Ganesan)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: dmentre at linux-france.org (David MENTRE)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: der.herr at hofr.at (Nicholas Mc Guire)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: pascal.cuoq at gmail.com (Pascal Cuoq)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: nicky.williams at cea.fr (Nicky Williams)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: pascal.cuoq at gmail.com (Pascal Cuoq)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: dganesan at fc-md.umd.edu (Dharmalingam Ganesan)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: loic.correnson at cea.fr (Loïc Correnson)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: dganesan at fc-md.umd.edu (Dharmalingam Ganesan)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: virgile.prevosto at m4x.org (Virgile Prevosto)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: dganesan at fc-md.umd.edu (Dharmalingam Ganesan)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- Prev by Date: [Frama-c-discuss] Frama-C: Detecting unreachable code?
- Next by Date: [Frama-c-discuss] Frama-C: Detecting unreachable code?
- Previous by thread: [Frama-c-discuss] Frama-C: Detecting unreachable code?
- Next by thread: [Frama-c-discuss] Frama-C: Detecting unreachable code?
- Index(es):