File tree 5 files changed +26
-12
lines changed
5 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,8 @@ bool c_preprocess_visual_studio(
253
253
254
254
// This marks the command file as UTF-8, which Visual Studio
255
255
// understands.
256
- command_file << char (0xef ) << char (0xbb ) << char (0xbf );
256
+ command_file << (unsigned char )0xefu << (unsigned char )0xbbu
257
+ << (unsigned char )0xbfu ;
257
258
258
259
command_file << " /nologo" << ' \n ' ;
259
260
command_file << " /E" << ' \n ' ;
Original file line number Diff line number Diff line change @@ -182,9 +182,9 @@ void ms_cl_cmdlinet::process_response_file(const std::string &file)
182
182
// these may be Unicode -- which is indicated by 0xff 0xfe
183
183
std::string line;
184
184
getline (infile, line);
185
- if (line. size ()>= 2 &&
186
- line[ 0 ]== static_cast <char >(0xff ) &&
187
- line[1 ]== static_cast < char >( 0xfe ) )
185
+ if (
186
+ line. size () >= 2 && static_cast <unsigned char >(line[ 0 ]) == 0xffu &&
187
+ static_cast < unsigned char >( line[1 ]) == 0xfeu )
188
188
{
189
189
// Unicode, UTF-16 little endian
190
190
@@ -208,10 +208,10 @@ void ms_cl_cmdlinet::process_response_file(const std::string &file)
208
208
209
209
#endif
210
210
}
211
- else if (line. size ()>= 3 &&
212
- line[0 ]== static_cast < char >( 0xef ) &&
213
- line[1 ]== static_cast < char >( 0xbb ) &&
214
- line[2 ]== static_cast < char >( 0xbf ) )
211
+ else if (
212
+ line. size () >= 3 && static_cast < unsigned char >( line[0 ]) == 0xefu &&
213
+ static_cast < unsigned char >( line[1 ]) == 0xbbu &&
214
+ static_cast < unsigned char >( line[2 ]) == 0xbfu )
215
215
{
216
216
// This is the UTF-8 BOM. We can proceed as usual, since
217
217
// we use UTF-8 internally.
Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ void ms_link_cmdlinet::process_response_file(const std::string &file)
120
120
std::string line;
121
121
getline (infile, line);
122
122
if (
123
- line.size () >= 2 && line[0 ] == static_cast < char >( 0xff ) &&
124
- line[1 ] == static_cast < char >( 0xfe ) )
123
+ line.size () >= 2 && static_cast < unsigned char >( line[0 ]) == 0xffu &&
124
+ static_cast < unsigned char >( line[1 ]) == 0xfeu )
125
125
{
126
126
// Unicode, UTF-16 little endian
127
127
@@ -146,8 +146,9 @@ void ms_link_cmdlinet::process_response_file(const std::string &file)
146
146
#endif
147
147
}
148
148
else if (
149
- line.size () >= 3 && line[0 ] == static_cast <char >(0xef ) &&
150
- line[1 ] == static_cast <char >(0xbb ) && line[2 ] == static_cast <char >(0xbf ))
149
+ line.size () >= 3 && static_cast <unsigned char >(line[0 ]) == 0xefu &&
150
+ static_cast <unsigned char >(line[1 ]) == 0xbbu &&
151
+ static_cast <unsigned char >(line[2 ]) == 0xbfu )
151
152
{
152
153
// This is the UTF-8 BOM. We can proceed as usual, since
153
154
// we use UTF-8 internally.
Original file line number Diff line number Diff line change @@ -223,7 +223,13 @@ void smt2_tokenizert::get_token_from_stream()
223
223
case ' ' :
224
224
case ' \r ' :
225
225
case ' \t ' :
226
+ #include < util/pragma_push.def>
227
+ #ifdef _MSC_VER
228
+ #pragma warning(disable : 4309)
229
+ // truncation of constant value
230
+ #endif
226
231
case static_cast <char >(160 ): // non-breaking space
232
+ #include < util/pragma_pop.def>
227
233
// skip any whitespace
228
234
break ;
229
235
Original file line number Diff line number Diff line change @@ -1120,10 +1120,16 @@ bool configt::set(const cmdlinet &cmdline)
1120
1120
INVARIANT (
1121
1121
ansi_c.double_width == sizeof (double ) * CHAR_BIT,
1122
1122
" double width shall be equal to the system double width" );
1123
+ #include < util/pragma_push.def>
1124
+ #ifdef _MSC_VER
1125
+ #pragma warning(disable : 4309)
1126
+ // truncation of constant value
1127
+ #endif
1123
1128
INVARIANT (
1124
1129
ansi_c.char_is_unsigned ==
1125
1130
(static_cast <char >((1 << CHAR_BIT) - 1 ) == (1 << CHAR_BIT) - 1 ),
1126
1131
" char_is_unsigned flag shall indicate system char unsignedness" );
1132
+ #include < util/pragma_pop.def>
1127
1133
1128
1134
#ifndef _WIN32
1129
1135
// On Windows, long double width varies by compiler
You can’t perform that action at this time.
0 commit comments