2021-03-03 03:33 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001467Frama-CKernelpublic2017-12-06 09:10
Assigned Tovalentin.perrelle 
Product VersionFrama-C Fluorine-20130601 
Target VersionFixed in VersionFrama-C 16-Sulfur 
Summary0001467: Parser does not handle mixed concatenations of wide and non-wide strings
Description~/ppc $ cat tests/misc/wstring_phase6.i
/* run.config
   OPT: -journal-disable -print

// See http://stackoverflow.com/questions/18102502/mixing-wide-and-narrow-string-literals-in-c
printf( "%s\n", "123" "456" );
printf( "%ls\n", L"123" L"456" );
printf( "%ls\n", "123" L"456" );
printf( "%ls\n", L"123" "456" );
printf( "%ls\n", L"123" L"456" );
~/ppc $ bin/toplevel.opt -print tests/misc/wstring_phase6.i
tests/misc/wstring_phase6.i:9:[kernel] user error: syntax error
[kernel] user error: skipping file "tests/misc/wstring_phase6.i" that has errors.
[kernel] Frama-C aborted: invalid user input.
~/ppc $
Additional InformationAs commented in the test, the behavior is defined and is explained in http://stackoverflow.com/questions/18102502/mixing-wide-and-narrow-string-literals-in-c
TagsNo tags attached.
Attached Files




yakobowski (manager)

There is already a comment to that effect in cil/src/front/clexer.mll. Search for "matth: BUG: this could be either a regular string or a wide string.". Fixing the lexer does not seem easy.

Fixing the parser is also complicated. The productions for wstring_list and string_list do not have the same type, so it is not possible to switch from a non-wide string to a wide one when we finally notice a L. And inside an LALR(1) parser, we cannot look at the token stream to see if an L is coming.


virgile (developer)

Fixed in dev. Will appear in FC 16 Sulfur

-Issue History
Date Modified Username Field Change
2013-08-07 14:12 pascal New Issue
2013-09-07 11:20 yakobowski Note Added: 0004064
2013-09-07 11:20 yakobowski Assigned To => pascal
2013-09-07 11:20 yakobowski Severity trivial => feature
2013-09-07 11:20 yakobowski Status new => assigned
2013-09-07 11:20 yakobowski Additional Information Updated
2013-09-09 14:19 svn
2013-12-19 01:11 pascal Source_changeset_attached => framac master 746736bd
2014-02-12 16:53 pascal Source_changeset_attached => framac stable/neon 746736bd
2016-07-05 17:34 yakobowski Assigned To pascal =>
2016-07-05 17:34 yakobowski Status assigned => confirmed
2017-05-04 15:55 yakobowski Assigned To => valentin.perrelle
2017-05-04 15:55 yakobowski Status confirmed => assigned
2017-06-09 19:55 virgile Note Added: 0006406
2017-06-09 19:55 virgile Status assigned => resolved
2017-06-09 19:55 virgile Resolution open => fixed
2017-06-09 19:55 virgile Fixed in Version => Frama-C GIT, precise the release id
2017-12-06 09:09 signoles Fixed in Version Frama-C GIT, precise the release id => Frama-C 16-Sulfur
2017-12-06 09:10 signoles Status resolved => closed
+Issue History