]> git.pond.sub.org Git - empserver/commitdiff
common/pathfind: A more portable DPRINTF()
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 30 Dec 2020 12:40:47 +0000 (13:40 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jan 2021 07:39:13 +0000 (08:39 +0100)
C99 requires at least one argument for the "..." in a variadic macro.
GCC and Clang don't care, but warn with -pedantic.  Solaris cc warns.

The warning is easy to avoid, so do it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/common/pathfind.c

index 0db83e086ab8cb5a439facd6115961d737264ebe..8d6a3c67b18537aa67136b8af27d81399dd39bd1 100644 (file)
@@ -27,7 +27,7 @@
  *  pathfind.c: Find cheapest paths
  *
  *  Known contributors to this file:
- *     Markus Armbruster, 2014
+ *     Markus Armbruster, 2014-2020
  */
 
 #include <config.h>
@@ -42,9 +42,9 @@
 #include "sect.h"
 
 #ifdef PATH_FIND_DEBUG
-#define DPRINTF(fmt, ...) ((void)printf(fmt , ## __VA_ARGS__))
+#define DPRINTF(...) ((void)fprintf(stdout, ## __VA_ARGS__))
 #else
-#define DPRINTF(fmt, ...) ((void)0)
+#define DPRINTF(...) ((void)0)
 #endif
 
 static char *bufrotate(char *buf, size_t bufsz, size_t i);