2021-03-01 04:25 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002090Frama-CKernelpublic2016-01-26 08:52
Reportervirgile 
Assigned Toyakobowski 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Product VersionFrama-C GIT, precise the release id 
Target VersionFixed in VersionFrama-C Magnesium 
Summary0002090: unary negation of enum constant always yield 0
DescriptionThe following code (note that g is only here to retain the enum definition itself in the generated AST).

enum Foo { E1, E2, E3 };

int f() { return !E1; }

int g() { return E1; }

is translated by Frama-C as

enum Foo {
    E1 = 0,
    E2 = 1,
    E3 = 2
};
int f(void)
{
  int __retres;
  __retres = 0;
  return __retres;
}

int g(void)
{
  int __retres;
  __retres = E1;
  return __retres;
}

f should in fact return 1, as E1 is bound to 0
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0005809

yakobowski (manager)

Fix committed to master branch.
+Notes

-Issue History
Date Modified Username Field Change
2015-03-19 10:48 virgile New Issue
2015-03-19 10:48 virgile Status new => assigned
2015-03-19 10:48 virgile Assigned To => virgile
2015-03-19 11:02 yakobowski Assigned To virgile =>
2015-03-19 11:02 yakobowski Assigned To => yakobowski
2015-03-19 11:02 yakobowski Status assigned => new
2015-03-20 19:13 yakobowski Source_changeset_attached => framac master 9187b2cb
2015-03-20 19:13 yakobowski Note Added: 0005809
2015-03-20 19:13 yakobowski Status new => resolved
2015-03-20 19:13 yakobowski Resolution open => fixed
2016-01-26 08:51 signoles Fixed in Version => Frama-C Magnesium
2016-01-26 08:52 signoles Status resolved => closed
+Issue History