On Wed, 3 Jul 2013, Mark Kettenis wrote:
> > Date: Wed, 3 Jul 2013 16:40:17 +0200 (CEST)
> > From: Stefan Fritsch <s...@sfritsch.de>
> > 
> > don't pass empty format string in subr_disk.c
> > 
> > this is necessary to enable -Wformat or -Wno-error=format
> 
> Don't think this one makes much sense.  Better to just do:
> 
>   log(pri, "%s", "");
> 
> and keep the rest of the code as it is.  Not sure what the static
> const trickery was necessary for though.

Yes, that's simpler and also works AFAICT

--- sys/kern/subr_disk.c
+++ sys/kern/subr_disk.c
@@ -761,8 +761,7 @@ diskerr(struct buf *bp, char *dname, char *what, int pri, 
int blkdone,
        daddr_t sn;
 
        if (pri != LOG_PRINTF) {
-               static const char fmt[] = "";
-               log(pri, fmt);
+               log(pri, "%s", "");
                pr = addlog;
        } else
                pr = printf;
-- 
1.7.6

Reply via email to