]> granicus.if.org Git - libtirpc/commitdiff
Remove variadic macro invocation
authorChuck Lever <chuck.lever@oracle.com>
Mon, 1 Jul 2013 13:40:02 +0000 (09:40 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 1 Jul 2013 13:57:47 +0000 (09:57 -0400)
Commit f8104ba9 "Fix debugging reference from non-GSS to optional"
GSS code.", Thu Apr 26 15:12:08 2012, introduces a variadic macro
invocation (a GNU C extension) in the rpc/auth.h header.

An attempt was made to hide the extension behind #ifdef __GNUC__
but the #else arm also uses the same synopsis, so the variadic macro
is visible for non-GNU C compiles as well.

With gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8) on Fedora 18, I
see:

/usr/include/tirpc/rpc/auth.h:255:32: warning: ISO C does not permit
  named variadic macros [-Wvariadic-macros]

I imagine this warning is produced by the "-pedantic" gcc option,
which I use in various projects that depend on libtirpc headers.

Rather than further cluttering the code in auth.h, we can live
without this debugging message.

Cc: Nick Alcock <nick.alcock@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
tirpc/rpc/auth.h

index e7bbe36273c881edce7b72da3e7ba2cf5ced039c..4ce11f0a3805b2e5f60f505ab529f595fcb6a041 100644 (file)
@@ -51,7 +51,6 @@
 #include <sys/cdefs.h>
 #include <sys/socket.h>
 #include <sys/types.h>
-#include <stdio.h>
 
 
 #define MAX_AUTH_BYTES 400
@@ -249,19 +248,11 @@ auth_put(AUTH *auth)
 #define auth_refresh(auth, msg)                \
                ((*((auth)->ah_ops->ah_refresh))(auth, msg))
 
-#if defined(__GNUC__) && defined(DEBUG)
-#define auth_log_debug(fmt,args...) printf(stderr, fmt, args)
-#else
-#define auth_log_debug(fmt,args...)
-#endif
-
 #define AUTH_DESTROY(auth)                                             \
                do {                                                    \
                        int refs;                                       \
                        if ((refs = auth_put((auth))) == 0)             \
                                ((*((auth)->ah_ops->ah_destroy))(auth));\
-                       auth_log_debug("%s: auth_put(), refs %d\n",     \
-                               __func__, refs);                        \
                } while (0)
 
 #define auth_destroy(auth)                                             \
@@ -269,8 +260,6 @@ auth_put(AUTH *auth)
                        int refs;                                       \
                        if ((refs = auth_put((auth))) == 0)             \
                                ((*((auth)->ah_ops->ah_destroy))(auth));\
-                       auth_log_debug("%s: auth_put(), refs %d\n",     \
-                               __func__, refs);                        \
                } while (0)
 
 #define AUTH_WRAP(auth, xdrs, xfunc, xwhere)            \