File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,12 @@ static mp_obj_t extra_coverage(void) {
230
230
mp_printf (& mp_plat_print , "%u\n" , 0x80000000 ); // should print unsigned
231
231
mp_printf (& mp_plat_print , "%x\n" , 0x8000000f ); // should print unsigned
232
232
mp_printf (& mp_plat_print , "%X\n" , 0x8000000f ); // should print unsigned
233
- mp_printf (& mp_plat_print , "abc\n%" ); // string ends in middle of format specifier
233
+ // note: storing the string in a variable is enough to prevent the
234
+ // format string checker from checking this format string. Otherwise,
235
+ // it would be a compile time diagnostic under the format string
236
+ // checker.
237
+ const char msg [] = "abc\n%" ;
238
+ mp_printf (& mp_plat_print , msg ); // string ends in middle of format specifier
234
239
mp_printf (& mp_plat_print , "%%\n" ); // literal % character
235
240
mp_printf (& mp_plat_print , ".%-3s.\n" , "a" ); // left adjust
236
241
You can’t perform that action at this time.
0 commit comments