From 8fd954ac8e7fe5d2770d74c3780bdd5f44aa0906 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 26 Sep 2014 13:52:55 +0200 Subject: build: add -Wno-format-zero-length This warning makes absolutely no sense. Passing an empty string to printf-like functions is perfectly fine. In the OSD case, it just sets an empty message, practically clearing the OSD. --- old-configure | 4 +++- player/command.c | 2 +- player/osd.c | 2 +- waftools/detections/compiler.py | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/old-configure b/old-configure index c57305e409..c216d4f882 100755 --- a/old-configure +++ b/old-configure @@ -380,9 +380,11 @@ addcflags() { cflag_check "$@" && OURCFLAGS="$OURCFLAGS $@" ; } OURCFLAGS="-std=c99 -Wall $_opt" addcflags -g -g3 -ggdb -addcflags -Wundef -Wmissing-prototypes -Wshadow -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Werror=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-error=unused-function -Wempty-body +addcflags -Wundef -Wmissing-prototypes -Wshadow -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Werror=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-error=unused-function # clang addcflags -Wno-logical-op-parentheses -fcolor-diagnostics -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare +# extra +addcflags -Wno-format-zero-length -Wempty-body -Wdisabled-optimization -Wstrict-prototypes cflag_check -MD -MP && DEPFLAGS="-MD -MP" cflag_check -lm && _ld_lm="-lm" diff --git a/player/command.c b/player/command.c index c37e45faec..0399905e23 100644 --- a/player/command.c +++ b/player/command.c @@ -3698,7 +3698,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) if (opts->osd_level > 0) { set_osd_msg(mpctx, osdl, osd_duration, "OSD level: %d", opts->osd_level); } else { - set_osd_msg(mpctx, 0, 0, "%s", ""); + set_osd_msg(mpctx, 0, 0, ""); } break; } diff --git a/player/osd.c b/player/osd.c index f1495a21a9..15cceab95f 100644 --- a/player/osd.c +++ b/player/osd.c @@ -422,7 +422,7 @@ static void add_seek_osd_messages(struct MPContext *mpctx) if (mpctx->add_osd_seek_info & OSD_SEEK_INFO_TEXT) { // Never in term-osd mode if (mpctx->video_out && mpctx->opts->term_osd != 1) { - if (set_osd_msg(mpctx, 1, mpctx->opts->osd_duration, "%s", "")) + if (set_osd_msg(mpctx, 1, mpctx->opts->osd_duration, "")) mpctx->osd_show_pos = true; } } diff --git a/waftools/detections/compiler.py b/waftools/detections/compiler.py index b98218856f..792511af33 100644 --- a/waftools/detections/compiler.py +++ b/waftools/detections/compiler.py @@ -38,6 +38,7 @@ def __add_gcc_flags__(ctx): __test_and_add_flags__(ctx, ["-Wempty-body"]) __test_and_add_flags__(ctx, ["-Wdisabled-optimization"]) __test_and_add_flags__(ctx, ["-Wstrict-prototypes"]) + __test_and_add_flags__(ctx, ["-Wno-format-zero-length"]) def __add_clang_flags__(ctx): ctx.env.CFLAGS += ["-Wno-logical-op-parentheses", "-fcolor-diagnostics", -- cgit v1.2.3