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 #1

Updated by Evgeny Novikov over 5 years ago

  • Blocks Bug #6629: Used CIL is outdated added
Actions #2

Updated by Evgeny Novikov over 5 years ago

  • Related to Bug #9534: Incorrect printing of Linux BUILD_BUG_ON added
Actions #3

Updated by Mikhail Mandrykin over 5 years ago

This is actually an old bug that was already fixed in Silicon (v14.0), but was somehow lost during the merge in b8012367. Fixed in f2445d34

Actions #4

Updated by Evgeny Novikov over 5 years ago

The fix works well! Merges do can bring strange issues, so, there is nothing surprising. Please, close the issue.

Actions #5

Updated by Mikhail Mandrykin over 5 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF