Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • F frama-c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 168
    • Issues 168
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pub
  • frama-c
  • Issues
  • #181

Missing cast in code generated by RTE

ID0002419: This issue was created automatically from Mantis Issue 2419. Further discussion may take place here.


Id Project Category View Due Date Updated
ID0002419 Frama-C Plug-in > RTE public 2018-12-17 2018-12-17
Reporter signoles Assigned To signoles Resolution open
Priority normal Severity minor Reproducibility always
Platform - OS - OS Version -
Product Version Frama-C 18-Argon Target Version - Fixed in Version -

Description :

========== int main(void) { int i = 2; unsigned int j = i < 2; return 0; }

$ frama-c -check -rte -warn-unsigned-downcast -print -ocode res.c [kernel] Parsing a.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C / int main(void) { int __retres; int i = 2; /@ assert rte: unsigned_downcast: (i < 2) ≤ 4294967295; / /@ assert rte: unsigned_downcast: 0 ≤ (i < 2); */ unsigned int j = (unsigned int)(i < 2); __retres = 0; return __retres; }

$ frama-c res.c [kernel] Parsing res.c (with preprocessing) [kernel:annot-error] res.c:6: Warning: comparison of incompatible types: 𝔹 and ℤ. Ignoring code annotation [kernel] User Error: warning annot-error treated as fatal error.

The terms (i < 2) should be casted to int in the generated predicates

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking