On Wed, Aug 30, 2017 at 05:54:16PM +0100, Ricardo Mestre wrote:

> Hi,
> 
> Unbreak DEBUG for nfsd(8), this one was caught with cppcheck.
> 
> It has been broken for about 7 years ago when a couple of errx calls, which 
> had
> string format arguments, were replaced by syslog calls.

Can you please formulate this without using a GNU extension, i.e. the
standard knows 

        #define X A(a, ...)     bla

but not 

        #define X A(a...)       bla

        -Otto

> 
> OK?
> 
> Index: nfsd.c
> ===================================================================
> RCS file: /cvs/src/sbin/nfsd/nfsd.c,v
> retrieving revision 1.36
> diff -u -p -u -r1.36 nfsd.c
> --- nfsd.c    7 Jun 2016 01:29:38 -0000       1.36
> +++ nfsd.c    30 Aug 2017 10:57:55 -0000
> @@ -64,7 +64,11 @@
>  
>  /* Global defs */
>  #ifdef DEBUG
> -#define      syslog(e, s)    fprintf(stderr,(s))
> +#define      syslog(e, s, a...)              \
> +do {                                 \
> +     fprintf(stderr, (s), ## a);     \
> +     fprintf(stderr, "\n");          \
> +} while (0)
>  int  debug = 1;
>  #else
>  int  debug = 0;

Reply via email to