summaryrefslogtreecommitdiff
path: root/ports/unix/coverage.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/unix/coverage.c')
-rw-r--r--ports/unix/coverage.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c
index 68340d7f2..5bd02f6fb 100644
--- a/ports/unix/coverage.c
+++ b/ports/unix/coverage.c
@@ -230,7 +230,12 @@ static mp_obj_t extra_coverage(void) {
mp_printf(&mp_plat_print, "%u\n", 0x80000000); // should print unsigned
mp_printf(&mp_plat_print, "%x\n", 0x8000000f); // should print unsigned
mp_printf(&mp_plat_print, "%X\n", 0x8000000f); // should print unsigned
- mp_printf(&mp_plat_print, "abc\n%"); // string ends in middle of format specifier
+ // note: storing the string in a variable is enough to prevent the
+ // format string checker from checking this format string. Otherwise,
+ // it would be a compile time diagnostic under the format string
+ // checker.
+ const char msg[] = "abc\n%";
+ mp_printf(&mp_plat_print, msg); // string ends in middle of format specifier
mp_printf(&mp_plat_print, "%%\n"); // literal % character
mp_printf(&mp_plat_print, ".%-3s.\n", "a"); // left adjust