Skip to content

Commit

Permalink
[build] Avoid confusing sparse in single-argument DBG() macros
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Mar 22, 2017
1 parent 6124c0e commit e88e2a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/include/compiler.h
Expand Up @@ -403,7 +403,7 @@ char __debug_disable(OBJECT) = ( DBGLVL_MAX & ~DBGLVL_DFLT );
*
* @v level Debug level
*/
#define DBG_PAUSE_IF( level ) do { \
#define DBG_PAUSE_IF( level, ... ) do { \
if ( DBG_ ## level ) { \
dbg_pause(); \
} \
Expand All @@ -414,7 +414,7 @@ char __debug_disable(OBJECT) = ( DBGLVL_MAX & ~DBGLVL_DFLT );
*
* @v level Debug level
*/
#define DBG_MORE_IF( level ) do { \
#define DBG_MORE_IF( level, ... ) do { \
if ( DBG_ ## level ) { \
dbg_more(); \
} \
Expand Down

0 comments on commit e88e2a2

Please sign in to comment.