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?

Yes, I refer "Integer Promotion" for my course at UMD. I was thinking of using Frama-C for my course to demonstrate some examples.

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. 

unsigned int i = 0;

void myFun()


[formal_verification]$ 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:5:[value] assigning non deterministic value for the first time
[value] Recording results for myFun
[value] done for function myFun
[value] ====== VALUES COMPUTED ======
[value] Values at end of function myFun:
          i ? [--..--]

From: frama-c-discuss-bounces at [frama-c-discuss-bounces at] On Behalf Of Pascal Cuoq [pascal.cuoq at]
Sent: Saturday, January 25, 2014 3:00 PM
To: Frama-C public discussion
Subject: Re: [Frama-c-discuss] Frama-C: Detecting unreachable code?

On Sat, Jan 25, 2014 at 8:47 PM, Dharmalingam Ganesan <dganesan at<mailto:dganesan at>> wrote:
I looked at the code generated by RTE. I wonder why it casts unsigned int into int types?

Because this is how the C language works

Please see<> , especially ?integer promotions? in section 6.3.

Is it a bug in RTE?