Skip to content

ask CL preprocessor for UTF-8 output #2330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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