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
  • #228

user error: scalar value (of type int) initialized by compound initializer

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


Id Project Category View Due Date Updated
ID0002384 Frama-C Kernel public 2018-07-04 2018-11-30
Reporter evdenis Assigned To valentin.perrelle Resolution fixed
Priority normal Severity minor Reproducibility always
Platform - OS - OS Version -
Product Version Frama-C 17-Chlorine Target Version - Fixed in Version Frama-C 18-Argon

Description :

Example:

struct test {
   union {
      int a;
      long b;
   };
};

static struct test t = { { .a = 0 } };

Run:

$ gcc -c test.c
$ echo $?
0
$ frama-c test.c

Error Log:

[kernel] Parsing test.c (with preprocessing)
[kernel] test.c:1: Warning:
  unnamed fields are a C11 extension (use -c11 to avoid this warning)
[kernel] test.c:8: User Error:
  scalar value (of type int) initialized by compound initializer
  6     };
  7
  8     static struct test t = { { .a = 0 } };
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[kernel] User Error: stopping on file "test.c" that has errors. Add '-kernel-msg-key pp'
  for preprocessing command.
[kernel] Frama-C aborted: invalid user input.

Frama-C Version:

$ frama-c -version
Chlorine-20180501

Attachments

  • test.c
  • restore-initializers.patch
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking