Skip to content

Commit

Permalink
Merge pull request diffblue#2330 from diffblue/msvc-utf8
Browse files Browse the repository at this point in the history
ask CL preprocessor for UTF-8 output
  • Loading branch information
Daniel Kroening authored Jun 9, 2018
2 parents 1df3b9d + bdd5bbb commit 0f2cc3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion buildspec-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ phases:
Remove-Item ansi-c\Forward_Declaration2 -Force -Recurse
Remove-Item ansi-c\Incomplete_Type1 -Force -Recurse
Remove-Item ansi-c\Union_Padding1 -Force -Recurse
Remove-Item ansi-c\Universal_characters1 -Force -Recurse
Remove-Item ansi-c\function_return1 -Force -Recurse
Remove-Item ansi-c\gcc_attributes7 -Force -Recurse
Remove-Item ansi-c\gcc_version1 -Force -Recurse
Expand Down
10 changes: 8 additions & 2 deletions src/ansi-c/c_preprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,14 @@ bool c_preprocess_visual_studio(
// understands.
command_file << char(0xef) << char(0xbb) << char(0xbf);

command_file << "/nologo" << "\n";
command_file << "/E" << "\n";
command_file << "/nologo" << '\n';
command_file << "/E" << '\n';

// This option will make CL produce utf-8 output, as
// opposed to 8-bit with some code page.
// It only works on Visual Studio 2015 or newer.
command_file << "/source-charset:utf-8" << '\n';

command_file << "/D__CPROVER__" << "\n";
command_file << "/D__WORDSIZE=" << config.ansi_c.pointer_width << "\n";

Expand Down

0 comments on commit 0f2cc3a

Please sign in to comment.