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: dmentre at linux-france.org (David MENTRE)
- Date: Mon, 27 Jan 2014 09:29:40 +0100
- In-reply-to: <B517F47C2F6D914AA8121201F9EBEE6701C7660449AD@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> <B517F47C2F6D914AA8121201F9EBEE6701C7660449AC@Mail1.FCMD.local>, <CAOH62JgQWFnHP0tW8H-ti7JYj48qRJzM-jJ0AqBNOAATSDYFvA@mail.gmail.com> <B517F47C2F6D914AA8121201F9EBEE6701C7660449AD@Mail1.FCMD.local>
Hello Dharmalingam, Le 25/01/2014 21:17, Dharmalingam Ganesan a ?crit : > For this below function, the value plugin says the > > [value] Values at end of function myFun: > i ? [--..--] > > > In my understanding [--, --] refers to all possible integers. But, the value of i for this function can never be below zero. In fact, Value analysis knows about this fact, see below "Frama_C_show_each_i([0..4294967295])". Maybe Value prints "[--..--]" because the whole range of variable "i" is seen? ------------ unsigned int i = 0; void myFun() { i++; Frama_C_show_each_i(i); } ----------- $ frama-c -val unint.c -main myFun -lib-entry [kernel] preprocessing with "gcc -C -E -I. unint.c" [value] Analyzing an incomplete application starting at myFun [value] Computing initial state [value] Initial state computed [value] Values of globals at initialization i ? [--..--] unint.c:6:[value] assigning non deterministic value for the first time [value] Called Frama_C_show_each_i([0..4294967295]) unint.c:8:[value] Assertion got status valid. unint.c:3:[value] Function myFun: postcondition got status valid. [value] Recording results for myFun [value] done for function myFun [value] ====== VALUES COMPUTED ====== [value] Values at end of function myFun: i ? [--..--] In below int.c program (with an "int" instead of "unsigned int"), the Value analysis computes the correct range for i: --------------- #include <limits.h> int i = 0; void myFun() { if (i == INT_MAX) { i = 0; } i++; Frama_C_show_each_i(i); } void main(void) { while (Frama_C_nondet(0,1)) { myFun(); } } ---------------- $ frama-c -val `frama-c -print-share-path`/builtin.c -slevel 10 int.c [...] [value] ====== VALUES COMPUTED ====== [value] Values at end of function Frama_C_nondet: Frama_C_entropy_source ? [--..--] [value] Values at end of function myFun: i ? [1..2147483647] [value] Values at end of function main: Frama_C_entropy_source ? [--..--] i ? [0..2147483647] Best regards, david
- Follow-Ups:
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- From: boris at yakobowski.org (Boris Yakobowski)
- [Frama-c-discuss] Frama-C: Detecting unreachable code?
- 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?
- 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?
- Prev by Date: [Frama-c-discuss] WP - How to represent duplicate assumes?
- Next by Date: [Frama-c-discuss] Frama-C: Detecting unreachable code? (Dharmalingam Ganesan)
- Previous by thread: [Frama-c-discuss] Frama-C: Detecting unreachable code?
- Next by thread: [Frama-c-discuss] Frama-C: Detecting unreachable code?
- Index(es):