2021-02-24 19:01 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002117Frama-CKernelpublic2016-01-26 08:52
Assigned Toyakobowski 
PlatformLinux debian 3.16.0-4-amd64 #1 SOSDebian GNU/LinuxOS VersionJessie
Product VersionFrama-C Sodium 
Target VersionFixed in VersionFrama-C Magnesium 
Summary0002117: frama-c gets confused by comma operator inside ternary operator: cannot cast from void to char
DescriptionGCC and Clang correctly parse and compile the testcase below, however frama-c considers it invalid (cannot cast from void to char).

In (char)(1?(((x)=6),1):0) AFAICT the type of (((x)=6),1) is integer, the void on the lhs of the comma operator should be ignored.
Steps To Reproduce$ cat >x.c <<EOF
void foo(void) {
    char x;

$ frama-c x.c
[kernel] Parsing FRAMAC_SHARE/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing x.c (with preprocessing)
x.c:3:[kernel] user error: cannot cast from void to char
[kernel] user error: stopping on file "x.c" that has errors. Add '-kernel-msg-key pp'
                     for preprocessing command.
[kernel] Frama-C aborted: invalid user input.
Additional Information$ frama-c --version
Version: Sodium-20150201
Compilation date: Thu May 7 22:46:49 EEST 2015
Share path: /home/edwin/.opam/system/share/frama-c (may be overridden with FRAMAC_SHARE variable)
Library path: /home/edwin/.opam/system/lib/frama-c (may be overridden with FRAMAC_LIB variable)
Plug-in paths: /home/edwin/.opam/system/lib/frama-c/plugins (may be overridden with FRAMAC_PLUGIN variable)

$ ocaml -vnum

I originally encountered this problem when trying to parse sqlite3 with frama-c, see the getVarint32 macro.
TagsNo tags attached.
Attached Files

related to 0001503closedvirgile failure: invalid implicit conversion from void to int 
related to 0002131closedyakobowski Error with casted ternary statements 



yakobowski (manager)

Fix committed to master branch.

-Issue History
Date Modified Username Field Change
2015-05-09 14:31 edwin New Issue
2015-05-10 22:55 yakobowski Relationship added related to 0001503
2015-05-12 21:51 yakobowski Assigned To => yakobowski
2015-05-12 21:51 yakobowski Status new => assigned
2015-05-29 10:20 yakobowski Source_changeset_attached => framac master 3f13c131
2015-05-29 10:20 yakobowski Note Added: 0005925
2015-05-29 10:20 yakobowski Status assigned => resolved
2015-05-29 10:20 yakobowski Resolution open => fixed
2015-06-05 16:15 yakobowski Relationship added related to 0002131
2016-01-26 08:51 signoles Fixed in Version => Frama-C Magnesium
2016-01-26 08:52 signoles Status resolved => closed
+Issue History