From ff292d530c126191bf220f70a8d114aa8f54e4b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 7 Apr 2013 20:11:21 +0100 Subject: [PATCH] printf: enable and fix compiler warnings But suppress -Wformat-nonliteral warnings since sprintf is used with a runtime-generated format string in our vasnprintf implementation. --- configure.ac | 4 ++++ gst/printf/Makefile.am | 2 +- gst/printf/vasnprintf.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 26ceca2..ca57a1f 100644 --- a/configure.ac +++ b/configure.ac @@ -618,6 +618,10 @@ fi dnl define an ERROR_CFLAGS Makefile variable AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs $NO_WARNINGS]) +dnl special warning flags for gst/printf +AS_COMPILER_FLAG([-Wno-format-nonliteral], [PRINTF_CFLAGS="-Wno-format-nonliteral"]) +AC_SUBST(PRINTF_CFLAGS) + dnl define correct level for debugging messages AG_GST_SET_LEVEL_DEFAULT($GST_GIT) diff --git a/gst/printf/Makefile.am b/gst/printf/Makefile.am index 67dc35f..5b9fbd4 100644 --- a/gst/printf/Makefile.am +++ b/gst/printf/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(GLIB_CFLAGS) -DSTATIC=G_GNUC_INTERNAL +AM_CPPFLAGS = $(GLIB_CFLAGS) -DSTATIC=G_GNUC_INTERNAL $(WARNING_CFLAGS) $(PRINTF_CFLAGS) noinst_LTLIBRARIES = libgstprintf.la diff --git a/gst/printf/vasnprintf.c b/gst/printf/vasnprintf.c index 41622ad..1cc5c0d 100644 --- a/gst/printf/vasnprintf.c +++ b/gst/printf/vasnprintf.c @@ -75,7 +75,7 @@ local_wcslen (const wchar_t * s) #endif #ifndef HAVE_LONG_LONG_FORMAT -static int +static inline int print_long_long (char *buf, int len, int width, -- 2.7.4