2021-01-27 10:43 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000961Frama-CKernelpublic2011-10-10 14:14
Assigned Tovirgile 
Product VersionFrama-C Carbon-20110201 
Target VersionFixed in VersionFrama-C Nitrogen-20111001 
Summary0000961: Cil incorrectly cast arguments to switch to int
DescriptionThe argument of a switch construct should not be cast to int (cf. The following program gives a reproducible test case.

int main () {
  unsigned int v = 0xAAAAAAAA;
  switch(v) {
  case 0xAAAAAAAA:
    return 0;
    printf("not taken\n");
    return 1;

Result with frama-c -val (current version, that handles switch)
__retres ? {1}

Compiled by gcc:

GCC's output is the correct one.

TagsNo tags attached.
Attached Files




yakobowski (manager)

Commit 15110 fixes the most problematic part of the problem: integral expressions are no longer cast to int, and non-integral ones are now properly rejected. However, some work remains to be done: the expressions on the labels must be cast to the type of the expression.


yakobowski (manager)

Commit 15110 was buggy in that it did not cas expressions that were too small to int. This is now corrected, but the second part of note 2255 still applies.


yakobowski (manager)

Fixed in revision 15381.

-Issue History
Date Modified Username Field Change
2011-09-13 14:50 yakobowski New Issue
2011-09-13 14:50 yakobowski Status new => assigned
2011-09-13 14:50 yakobowski Assigned To => virgile
2011-09-13 15:00 yakobowski Description Updated
2011-09-13 15:37 yakobowski Note Added: 0002255
2011-09-13 15:37 yakobowski Priority high => normal
2011-09-13 15:37 yakobowski Severity major => minor
2011-09-29 17:40 svn
2011-09-29 17:42 yakobowski Note Added: 0002341
2011-09-30 20:34 yakobowski Note Added: 0002372
2011-09-30 20:34 yakobowski Status assigned => resolved
2011-09-30 20:34 yakobowski Resolution open => fixed
2011-10-10 14:13 signoles Fixed in Version => Frama-C Nitrogen-20111001
2011-10-10 14:14 signoles Status resolved => closed
+Issue History