Skip to content
GitLab
Projects Groups 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
    • Contributors
    • Graph
    • Compare
  • Issues 173
    • Issues 173
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • 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
  • #2639
Closed
Open
Issue created Dec 21, 2022 by Nikolai Kosmatov@nkosmatovDeveloper

Parse-print-reparse error with ranges

Contextual information: currently used versions

  • Frama-C installation mode: Opam
  • Frama-C version 26.0beta
  • MetAcsl 0.4beta
  • Alt-Ergo 2.3.2
  • OS name: Ubuntu
  • OS version: 20.04

The issue

On the attached file, after parsing and printing the code, running frama-c again to parse the code produces an error (due to missing parentheses in ranges).

f.c

Here is the example

// Run frama-c on this file and pretty-print it:
// frama-c f.c -print -no-unicode -ocode f_printed.c

// Run on the resulting pretty-printed file:
// frama-c f_printed.c


typedef unsigned char uchar;
typedef unsigned long ulong;
typedef unsigned char *pchar;
uchar *Ref;
uchar Array[100];
/*@ ghost ulong FCG_Var1[1000]; */

/*@ ensures
      sep1:
        \let Ref_range = Ref + (0 .. (1 << (size)) - 1);
        \let PROP = \forall integer MyNum; 
          \let myrange = (0 .. (6 - 1));
          \let Var2 = &Array[FCG_Var1[MyNum]];
          \let CASE_i = 0 <= MyNum < 10;
          \let PROP_i =
            \separated(Ref_range, Var2 + myrange);
            CASE_i ==> PROP_i;
          PROP;
 */
static uchar myfun(pchar p_array, short index, uchar size)
{
  uchar __retres;
  return __retres;
}

Here is the error message:

[kernel] Parsing f_printed.c (with preprocessing)
[kernel:annot-error] f_printed.c:11: Warning: unexpected token '..'
[kernel] User Error: warning annot-error treated as fatal error.
[kernel] User Error: stopping on file "f_printed.c" that has errors. Add '-kernel-msg-key pp'
  for preprocessing command.
[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