[kernel] Parsing share/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing tests/spec/va.c (with preprocessing)
tests/spec/va.c:6:[kernel] warning: The second argument in call to __builtin_va_start should be the last formal argument
/* Generated by Frama-C */
typedef __builtin_va_list va_list;
typedef unsigned int size_t;
typedef unsigned int ino_t;
typedef unsigned int gid_t;
typedef unsigned int uid_t;
typedef long time_t;
typedef unsigned int blkcnt_t;
typedef unsigned int blksize_t;
typedef unsigned int dev_t;
typedef unsigned int mode_t;
typedef unsigned int nlink_t;
typedef long off_t;
struct stat {
   dev_t st_dev ;
   ino_t st_ino ;
   mode_t st_mode ;
   nlink_t st_nlink ;
   uid_t st_uid ;
   gid_t st_gid ;
   dev_t st_rdev ;
   off_t st_size ;
   time_t st_atime ;
   time_t st_mtime ;
   time_t st_ctime ;
   blksize_t st_blksize ;
   blkcnt_t st_blocks ;
};
struct __fc_pos_t {
   unsigned long __fc_stdio_position ;
};
typedef struct __fc_pos_t fpos_t;
struct __fc_FILE {
   unsigned int __fc_stdio_id ;
   fpos_t __fc_position ;
   char __fc_error ;
   char __fc_eof ;
   int __fc_flags ;
   struct stat *__fc_inode ;
   unsigned char *__fc_real_data ;
   int __fc_real_data_max_size ;
};
typedef struct __fc_FILE FILE;
/* compiler builtin: 
   void __builtin_va_start(__builtin_va_list);   */
extern int __FC_errno;

extern FILE *__fc_stdin;

extern FILE *__fc_stdout;

/*@ assigns \nothing; */
extern int remove(char const *filename);

/*@ assigns \nothing; */
extern int rename(char const *old_name, char const *new_name);

/*@ ensures
      \result ≡ \null ∨
      (\valid(\result) ∧ \fresh{Old, Here}(\result,sizeof(FILE)));
    assigns \nothing;
 */
extern FILE *tmpfile(void);

/*@ assigns \result, *(s+(..));
    assigns \result \from *(s+(..));
    assigns *(s+(..)) \from \nothing;
 */
extern char *tmpnam(char *s);

/*@ requires \valid(stream);
    ensures \result ≡ 0 ∨ \result ≡ -1;
    assigns \result;
    assigns \result \from stream, stream->__fc_stdio_id;
 */
extern int fclose(FILE *stream);

/*@ requires stream ≡ \null ∨ \valid_read(stream);
    ensures \result ≡ 0 ∨ \result ≡ -1;
    assigns \result;
    assigns \result \from stream, stream->__fc_stdio_id;
 */
extern int fflush(FILE *stream);

FILE __fc_fopen[512];
FILE * const __p_fc_fopen = __fc_fopen;
/*@ ensures \result ≡ \null ∨ \subset(\result, &__fc_fopen[0 .. 512-1]);
    assigns \result;
    assigns \result \from *(filename+(..)), *(mode+(..)), __p_fc_fopen;
 */
extern FILE *fopen(char const *filename, char const *mode);

/*@ ensures
      \result ≡ \null ∨
      (\valid(\result) ∧ \fresh{Old, Here}(\result,sizeof(FILE)));
    assigns \result;
    assigns \result \from fildes, *(mode+(..));
 */
extern FILE *fdopen(int fildes, char const *mode);

/*@ ensures \result ≡ \null ∨ \result ≡ \old(stream);
    assigns *stream;
 */
extern FILE *freopen(char const *filename, char const *mode, FILE *stream);

/*@ assigns *stream;
    assigns *stream \from buf; */
extern void setbuf(FILE *stream, char *buf);

/*@ assigns *stream;
    assigns *stream \from buf, mode, size; */
extern int setvbuf(FILE *stream, char *buf, int mode, size_t size);

/*@ assigns *stream;
    assigns *stream \from stream->__fc_stdio_id; */
extern int fprintf(FILE *stream, char const *format , ...);

/*@ assigns *stream;
    assigns *stream \from stream->__fc_stdio_id; */
extern int fscanf(FILE *stream, char const *format , ...);

/*@ assigns *__fc_stdout;
    assigns *__fc_stdout \from *(format+(..)); */
extern int printf(char const *format , ...);

/*@ assigns *__fc_stdin; */
extern int scanf(char const *format , ...);

/*@ assigns *(s+(0 .. n-1)); */
extern int snprintf(char *s, size_t n, char const *format , ...);

/*@ assigns *(s+(0 ..)); */
extern int sprintf(char *s, char const *format , ...);

/*@ assigns *stream;
    assigns *stream \from *(format+(..)), arg; */
extern int vfprintf(FILE *stream, char const *format, va_list arg);

/*@ assigns *stream;
    assigns *stream \from *(format+(..)), *stream; */
extern int vfscanf(FILE *stream, char const *format, va_list arg);

/*@ assigns *__fc_stdout;
    assigns *__fc_stdout \from arg; */
extern int vprintf(char const *format, va_list arg);

/*@ assigns *__fc_stdin;
    assigns *__fc_stdin \from *(format+(..)); */
extern int vscanf(char const *format, va_list arg);

/*@ assigns *(s+(0 .. n-1));
    assigns *(s+(0 .. n-1)) \from *(format+(..)), arg;
 */
extern int vsnprintf(char *s, size_t n, char const *format, va_list arg);

/*@ assigns *(s+(0 ..));
    assigns *(s+(0 ..)) \from *(format+(..)), arg; */
extern int vsprintf(char *s, char const *format, va_list arg);

/*@ assigns *stream; */
extern int fgetc(FILE *stream);

/*@ ensures \result ≡ \null ∨ \result ≡ \old(s);
    assigns *(s+(0 .. n-1)), *stream, \result;
    assigns *(s+(0 .. n-1)) \from *stream;
    assigns *stream \from *stream;
    assigns \result \from s, n, *stream;
 */
extern char *fgets(char *s, int n, FILE *stream);

/*@ assigns *stream; */
extern int fputc(int c, FILE *stream);

/*@ assigns *stream;
    assigns *stream \from *(s+(..)); */
extern int fputs(char const *s, FILE *stream);

/*@ assigns \result, *stream;
    assigns \result \from *stream;
    assigns *stream \from *stream;
 */
extern int getc(FILE *stream);

/*@ assigns \result;
    assigns \result \from *__fc_stdin; */
extern int getchar(void);

/*@ ensures \result ≡ \old(s) ∨ \result ≡ \null;
    assigns *(s+(..)), \result;
    assigns *(s+(..)) \from *__fc_stdin;
    assigns \result \from s, __fc_stdin;
 */
extern char *gets(char *s);

/*@ assigns *stream;
    assigns *stream \from c; */
extern int putc(int c, FILE *stream);

/*@ assigns *__fc_stdout;
    assigns *__fc_stdout \from c; */
extern int putchar(int c);

/*@ assigns *__fc_stdout;
    assigns *__fc_stdout \from *(s+(..)); */
extern int puts(char const *s);

/*@ assigns *stream;
    assigns *stream \from c; */
extern int ungetc(int c, FILE *stream);

/*@ requires \valid((char *)ptr+(0 .. nmemb*size-1));
    requires \valid(stream);
    ensures \result ≤ \old(nmemb);
    ensures \initialized((char *)\old(ptr)+(0 .. \result*\old(size)-1));
    assigns *((char *)ptr+(0 .. nmemb*size-1)), \result;
    assigns *((char *)ptr+(0 .. nmemb*size-1)) \from size, nmemb, *stream;
    assigns \result \from size, *stream;
 */
extern size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);

/*@ requires \valid_read((char *)ptr+(0 .. nmemb*size-1));
    requires \valid(stream);
    ensures \result ≤ \old(nmemb);
    assigns *stream, \result;
    assigns *stream \from *((char *)ptr+(0 .. nmemb*size-1));
    assigns \result \from *((char *)ptr+(0 .. nmemb*size-1));
 */
extern size_t fwrite(void const *ptr, size_t size, size_t nmemb, FILE *stream);

/*@ assigns *pos;
    assigns *pos \from *stream; */
extern int fgetpos(FILE *stream, fpos_t *pos);

/*@ assigns *stream, __FC_errno;
    assigns *stream \from offset, whence; */
extern int fseek(FILE *stream, long offset, int whence);

/*@ assigns *stream;
    assigns *stream \from *pos; */
extern int fsetpos(FILE *stream, fpos_t const *pos);

/*@ assigns \result, __FC_errno;
    assigns \result \from *stream;
    assigns __FC_errno \from *stream;
 */
extern long ftell(FILE *stream);

/*@ assigns *stream;
    assigns *stream \from \nothing; */
extern void rewind(FILE *stream);

/*@ assigns *stream;
    assigns *stream \from \nothing; */
extern void clearerr(FILE *stream);

/*@ assigns \result;
    assigns \result \from *stream; */
extern int feof(FILE *stream);

/*@ assigns \result;
    assigns \result \from *stream; */
extern int fileno(FILE *stream);

/*@ assigns *stream;
    assigns *stream \from \nothing; */
extern void flockfile(FILE *stream);

/*@ assigns *stream;
    assigns *stream \from \nothing; */
extern void funlockfile(FILE *stream);

/*@ assigns \result, *stream;
    assigns \result \from \nothing;
    assigns *stream \from \nothing;
 */
extern int ftrylockfile(FILE *stream);

/*@ assigns \result;
    assigns \result \from *stream; */
extern int ferror(FILE *stream);

/*@ assigns __fc_stdout;
    assigns __fc_stdout \from __FC_errno, *(s+(..)); */
extern void perror(char const *s);

/*@ assigns \result, *stream;
    assigns \result \from *stream;
    assigns *stream \from *stream;
 */
extern int getc_unlocked(FILE *stream);

/*@ assigns \result;
    assigns \result \from *__fc_stdin; */
extern int getchar_unlocked(void);

/*@ assigns *stream;
    assigns *stream \from c; */
extern int putc_unlocked(int c, FILE *stream);

/*@ assigns *__fc_stdout;
    assigns *__fc_stdout \from c; */
extern int putchar_unlocked(int c);

/*@ assigns *stream;
    assigns *stream \from \nothing; */
extern void clearerr_unlocked(FILE *stream);

/*@ assigns \result;
    assigns \result \from *stream; */
extern int feof_unlocked(FILE *stream);

/*@ assigns \result;
    assigns \result \from *stream; */
extern int ferror_unlocked(FILE *stream);

/*@ assigns \result;
    assigns \result \from *stream; */
extern int fileno_unlocked(FILE *stream);

void main(int x , ...)
{
  va_list p;
  __builtin_va_start(p,x);
  vscanf("FOO %d %d",p);
  return;
}


