Actions
Bug #9546
closedFrama-C (CIL) for GCC does not behave like GCC when casting ternary operators
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.
Updated by Evgeny Novikov over 5 years ago
- Blocks Bug #6629: Used CIL is outdated added
Updated by Evgeny Novikov over 5 years ago
- Related to Bug #9534: Incorrect printing of Linux BUILD_BUG_ON added
Updated by Mikhail Mandrykin over 5 years ago
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