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(
325325
326326 // This marks the command file as UTF-8, which Visual Studio
327327 // understands.
328- command_file << char (0xef ) << char (0xbb ) << char (0xbf );
328+ command_file << (unsigned char )0xefu << (unsigned char )0xbbu
329+ << (unsigned char )0xbfu ;
329330
330331 command_file << " /nologo" << ' \n ' ;
331332 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)
180180 // these may be Unicode -- which is indicated by 0xff 0xfe
181181 std::string line;
182182 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 )
186186 {
187187 // Unicode, UTF-16 little endian
188188
@@ -206,10 +206,10 @@ void ms_cl_cmdlinet::process_response_file(const std::string &file)
206206
207207 #endif
208208 }
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 )
213213 {
214214 // This is the UTF-8 BOM. We can proceed as usual, since
215215 // 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)
124124 std::string line;
125125 getline (infile, line);
126126 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 )
129129 {
130130 // Unicode, UTF-16 little endian
131131
@@ -150,8 +150,9 @@ void ms_link_cmdlinet::process_response_file(const std::string &file)
150150 #endif
151151 }
152152 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 )
155156 {
156157 // This is the UTF-8 BOM. We can proceed as usual, since
157158 // 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()
225225 case ' ' :
226226 case ' \r ' :
227227 case ' \t ' :
228+ #include < util/pragma_push.def>
229+ #ifdef _MSC_VER
230+ #pragma warning(disable : 4309)
231+ // truncation of constant value
232+ #endif
228233 case static_cast <char >(160 ): // non-breaking space
234+ #include < util/pragma_pop.def>
229235 // skip any whitespace
230236 break ;
231237
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ Author: Daniel Kroening, kroening@kroening.com
99#include " config.h"
1010
1111#include < cstdlib>
12+ #include < limits>
1213
1314#include " arith_tools.h"
1415#include " cmdline.h"
@@ -1001,16 +1002,22 @@ bool configt::set(const cmdlinet &cmdline)
10011002 INVARIANT (
10021003 ansi_c.double_width == sizeof (double ) * 8 ,
10031004 " 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
10041010 INVARIANT (
10051011 ansi_c.char_is_unsigned == (static_cast <char >(255 ) == 255 ),
10061012 " char_is_unsigned flag shall indicate system char unsignedness" );
1013+ #include < util/pragma_pop.def>
10071014
1008- #ifndef _WIN32
1015+ #ifndef _WIN32
10091016 // On Windows, long double width varies by compiler
10101017 INVARIANT (
10111018 ansi_c.long_double_width == sizeof (long double ) * 8 ,
10121019 " long double width shall be equal to the system long double width" );
1013- #endif
1020+ #endif
10141021 }
10151022
10161023 // the following allows overriding the defaults
You can’t perform that action at this time.
0 commit comments