File tree Expand file tree Collapse file tree 5 files changed +29
-14
lines changed Expand file tree Collapse file tree 5 files changed +29
-14
lines changed Original file line number Diff line number Diff line change @@ -325,7 +325,8 @@ bool c_preprocess_visual_studio(
325
325
326
326
// This marks the command file as UTF-8, which Visual Studio
327
327
// understands.
328
- command_file << char (0xef ) << char (0xbb ) << char (0xbf );
328
+ command_file << (unsigned char )0xefu << (unsigned char )0xbbu
329
+ << (unsigned char )0xbfu ;
329
330
330
331
command_file << " /nologo" << ' \n ' ;
331
332
command_file << " /E" << ' \n ' ;
Original file line number Diff line number Diff line change @@ -180,9 +180,9 @@ void ms_cl_cmdlinet::process_response_file(const std::string &file)
180
180
// these may be Unicode -- which is indicated by 0xff 0xfe
181
181
std::string line;
182
182
getline (infile, line);
183
- if (line. size ()>= 2 &&
184
- line[ 0 ]== static_cast <char >(0xff ) &&
185
- line[1 ]== static_cast < char >( 0xfe ) )
183
+ if (
184
+ line. size () >= 2 && static_cast <unsigned char >(line[ 0 ]) == 0xffu &&
185
+ static_cast < unsigned char >( line[1 ]) == 0xfeu )
186
186
{
187
187
// Unicode, UTF-16 little endian
188
188
@@ -206,10 +206,10 @@ void ms_cl_cmdlinet::process_response_file(const std::string &file)
206
206
207
207
#endif
208
208
}
209
- else if (line. size ()>= 3 &&
210
- line[0 ]== static_cast < char >( 0xef ) &&
211
- line[1 ]== static_cast < char >( 0xbb ) &&
212
- line[2 ]== static_cast < char >( 0xbf ) )
209
+ else if (
210
+ line. size () >= 3 && static_cast < unsigned char >( line[0 ]) == 0xefu &&
211
+ static_cast < unsigned char >( line[1 ]) == 0xbbu &&
212
+ static_cast < unsigned char >( line[2 ]) == 0xbfu )
213
213
{
214
214
// This is the UTF-8 BOM. We can proceed as usual, since
215
215
// we use UTF-8 internally.
Original file line number Diff line number Diff line change @@ -124,8 +124,8 @@ void ms_link_cmdlinet::process_response_file(const std::string &file)
124
124
std::string line;
125
125
getline (infile, line);
126
126
if (
127
- line.size () >= 2 && line[0 ] == static_cast < char >( 0xff ) &&
128
- line[1 ] == static_cast < char >( 0xfe ) )
127
+ line.size () >= 2 && static_cast < unsigned char >( line[0 ]) == 0xffu &&
128
+ static_cast < unsigned char >( line[1 ]) == 0xfeu )
129
129
{
130
130
// Unicode, UTF-16 little endian
131
131
@@ -150,8 +150,9 @@ void ms_link_cmdlinet::process_response_file(const std::string &file)
150
150
#endif
151
151
}
152
152
else if (
153
- line.size () >= 3 && line[0 ] == static_cast <char >(0xef ) &&
154
- line[1 ] == static_cast <char >(0xbb ) && line[2 ] == static_cast <char >(0xbf ))
153
+ line.size () >= 3 && static_cast <unsigned char >(line[0 ]) == 0xefu &&
154
+ static_cast <unsigned char >(line[1 ]) == 0xbbu &&
155
+ static_cast <unsigned char >(line[2 ]) == 0xbfu )
155
156
{
156
157
// This is the UTF-8 BOM. We can proceed as usual, since
157
158
// we use UTF-8 internally.
Original file line number Diff line number Diff line change @@ -225,7 +225,13 @@ void smt2_tokenizert::get_token_from_stream()
225
225
case ' ' :
226
226
case ' \r ' :
227
227
case ' \t ' :
228
+ #include < util/pragma_push.def>
229
+ #ifdef _MSC_VER
230
+ #pragma warning(disable : 4309)
231
+ // truncation of constant value
232
+ #endif
228
233
case static_cast <char >(160 ): // non-breaking space
234
+ #include < util/pragma_pop.def>
229
235
// skip any whitespace
230
236
break ;
231
237
Original file line number Diff line number Diff line change 9
9
#include " config.h"
10
10
11
11
#include < cstdlib>
12
+ #include < limits>
12
13
13
14
#include " arith_tools.h"
14
15
#include " cmdline.h"
@@ -1001,16 +1002,22 @@ bool configt::set(const cmdlinet &cmdline)
1001
1002
INVARIANT (
1002
1003
ansi_c.double_width == sizeof (double ) * 8 ,
1003
1004
" double width shall be equal to the system double width" );
1005
+ #include < util/pragma_push.def>
1006
+ #ifdef _MSC_VER
1007
+ #pragma warning(disable : 4309)
1008
+ // truncation of constant value
1009
+ #endif
1004
1010
INVARIANT (
1005
1011
ansi_c.char_is_unsigned == (static_cast <char >(255 ) == 255 ),
1006
1012
" char_is_unsigned flag shall indicate system char unsignedness" );
1013
+ #include < util/pragma_pop.def>
1007
1014
1008
- #ifndef _WIN32
1015
+ #ifndef _WIN32
1009
1016
// On Windows, long double width varies by compiler
1010
1017
INVARIANT (
1011
1018
ansi_c.long_double_width == sizeof (long double ) * 8 ,
1012
1019
" long double width shall be equal to the system long double width" );
1013
- #endif
1020
+ #endif
1014
1021
}
1015
1022
1016
1023
// the following allows overriding the defaults
You can’t perform that action at this time.
0 commit comments