Reduce warnings.
authorEmil Mikulic <emikulic@gmail.com>
Sun, 24 Mar 2013 17:36:26 +0000 (04:36 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Sun, 24 Mar 2013 17:36:26 +0000 (04:36 +1100)
buftee.c
tests/build.sh

index 7ab731b..8623515 100644 (file)
--- a/buftee.c
+++ b/buftee.c
@@ -188,7 +188,7 @@ static void _nblog_helper(int want_errno,
                           const char* format,
                           ...);  // Forward.
 
                           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,
 #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,
                           ...) {
                           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);
 
   va_list va;
   va_start(va, format);
 
@@ -398,7 +395,7 @@ static void _nblog_helper(int want_errno,
 
   // Prefix.
   char buf[512];
 
   // 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(),
   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(),
index d0cef60..ea04788 100755 (executable)
@@ -55,7 +55,7 @@ report build: gcc with all the warnings
 
 notice build: clang with all the warnings
 rm -f buftee
 
 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
 report build: clang
 
 notice finished