Project

General

Profile

Actions

Bug #9546

closed

Frama-C (CIL) for GCC does not behave like GCC when casting ternary operators

Added by Evgeny Novikov over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Urgent
Start date:
03/15/2019
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

For instance, for the following program:

void func(int arg)
{
        (long unsigned int)( arg  == 0 ? -1 : 1);
}

Frama-C (CIL) issues the following error:
[kernel] Parsing test.c (with preprocessing)
[kernel] test.c:4:1: User Error: 
  cannot cast from void to unsigned long

  2     void func(int arg)
  3     {
  4             (long unsigned int)( arg  == 0 ? -1 : 1);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  5     }
[kernel] User Error: skipping file test.c that has errors.
[kernel] Frama-C aborted: invalid user input.

when launched as follows:
toplevel.opt -no-autoload-plugins -no-findlib -machdep gcc_x86_64 test.c -print -print-lines -ocode test.cil.c

GCC can compile this code without any issues. You can read this discussion.


Related issues 2 (0 open2 closed)

Related to C Instrumentation Framework - Bug #9534: Incorrect printing of Linux BUILD_BUG_ONRejected03/13/2019

Actions
Blocks Klever - Bug #6629: Used CIL is outdatedClosedEvgeny Novikov03/13/2019

Actions
Actions

Also available in: Atom PDF