From c5cadceead92752d3da1feb7bffdad9f19ea01b1 Mon Sep 17 00:00:00 2001 From: Emil Mikulic Date: Mon, 25 Mar 2013 04:36:26 +1100 Subject: [PATCH] Reduce warnings. --- buftee.c | 9 +++------ tests/build.sh | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/buftee.c b/buftee.c index 7ab731b..8623515 100644 --- a/buftee.c +++ b/buftee.c @@ -188,7 +188,7 @@ static void _nblog_helper(int want_errno, const char* format, ...); // Forward. -#define nblog(fmt...) _nblog_helper(1, __LINE__, __FUNCTION__, fmt) +//#define nblog(fmt...) _nblog_helper(1, __LINE__, __FUNCTION__, fmt) #define nblogx(fmt...) _nblog_helper(0, __LINE__, __FUNCTION__, fmt) static void warn_time(const char* desc, @@ -383,10 +383,7 @@ static void _nblog_helper(int want_errno, const char* func, const char* format, ...) { - int saved_errno; - if (want_errno) - saved_errno = errno; - + int saved_errno = errno; va_list va; va_start(va, format); @@ -398,7 +395,7 @@ static void _nblog_helper(int want_errno, // Prefix. char buf[512]; - size_t len; + int len; extern char *__progname; // This is where glibc stashes argv[0]. len = snprintf(buf, sizeof(buf), "%s:%d:%s(): tid %d at %d.%09d: ", __progname, line, func, gettid(), diff --git a/tests/build.sh b/tests/build.sh index d0cef60..ea04788 100755 --- a/tests/build.sh +++ b/tests/build.sh @@ -55,7 +55,7 @@ report build: gcc with all the warnings notice build: clang with all the warnings rm -f buftee -env CC=$CLANG "CFLAGS=-Weverything" make +env CC=$CLANG "CFLAGS=-Weverything -Wno-padded -Wno-variadic-macros" make report build: clang notice finished -- 2.17.1