Browse Source

[build] Avoid confusing sparse in single-argument DBG() macros

For visual consistency with surrounding lines, the definitions of
DBG_MORE(), DBG_PAUSE(), etc include an unnecessary ##__VA_ARGS__
argument which is always elided.  This confuses sparse, which
complains about DBG_MORE_IF() being called with more than one
argument.

Work around this problem by adding an unused variable argument list to
the single-argument macros DBG_MORE_IF() and DBG_PAUSE_IF().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 years ago
parent
commit
e88e2a2965
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/include/compiler.h

+ 2
- 2
src/include/compiler.h View File

@@ -403,7 +403,7 @@ char __debug_disable(OBJECT) = ( DBGLVL_MAX & ~DBGLVL_DFLT );
403 403
  *
404 404
  * @v level		Debug level
405 405
  */
406
-#define DBG_PAUSE_IF( level ) do {				\
406
+#define DBG_PAUSE_IF( level, ... ) do {				\
407 407
 		if ( DBG_ ## level ) {				\
408 408
 			dbg_pause();				\
409 409
 		}						\
@@ -414,7 +414,7 @@ char __debug_disable(OBJECT) = ( DBGLVL_MAX & ~DBGLVL_DFLT );
414 414
  *
415 415
  * @v level		Debug level
416 416
  */
417
-#define DBG_MORE_IF( level ) do {				\
417
+#define DBG_MORE_IF( level, ... ) do {				\
418 418
 		if ( DBG_ ## level ) {				\
419 419
 			dbg_more();				\
420 420
 		}						\

Loading…
Cancel
Save