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
  • #1137
Closed
Open
Issue created Feb 13, 2014 by Pascal Cuoq@pascal

Initializer of static variable refers to size of type of local variable

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


Id Project Category View Due Date Updated
ID0001645 Frama-C Kernel public 2014-02-13 2014-03-24
Reporter pascal Assigned To virgile Resolution open
Priority low Severity minor Reproducibility always
Platform - OS - OS Version -
Product Version Frama-C Fluorine-20130601 Target Version - Fixed in Version -

Description :

CONTEXT: This issue does not originate from an industrial application. It is reported for the lulz.

DESCRIPTION: The program below is accepted by gcc and clang, and rejected by Frama-C. It seems that the compilers are right to accept it.

~ $ cat t.c

unsigned f(void) { int a; static unsigned s = sizeof(a); return s; }

~ $ clang -std=c99 -pedantic -Wall -c t.c ~ $ frama-c t.c [kernel] preprocessing with "gcc -C -E -I. t.c" t.c:4:[kernel] user error: Forbidden access to local variable a in static initializer [kernel] user error: skipping file "t.c" that has errors. [kernel] Frama-C aborted: invalid user input. ~ $

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