What am I doing wrong with this macro



I have a macro defined as:
#ifdef DEBUG
#define DEBUG_PRINT(level, format, a...) \
if ((level) & debug_level) cmn_err(CE_NOTE,"%s: " format, ##a)
#else
#define DEBUG_PRINT(level, format, a...)
#endif


In the code, I'll do this

DEBUG_PRINT(DEBUG_READ,"This is an Error Message\n");

When I compile, I'm getting the error message,"warning: argument
mismatch".

I copied the code from from of our programs written in linux and
replace the cmn_err statement to match Solaris.

What am I doing wrong?
.



Relevant Pages

  • Re: tracepoint maintainance models
    ... I made a quick macro example that would benefit to everybody. ... #ifdef CONFIG_PRINTLOG ... #define MAGIC_TRACE(event, format, args...) \ ...
    (Linux-Kernel)
  • Re: What am I doing wrong with this macro
    ... #ifdef DEBUG ... #define DEBUG_PRINT(level, format, a...) \ ... When I compile, I'm getting the error message,"warning: ...
    (comp.unix.solaris)
  • Why does this fix a warning message?
    ... #ifdef DEBUG ... In some projects, I get this nasty error, that the wrong library libcmt.lib is linked in debug mode. ... Since I'm sure, all my compilation options are OK, I wanted to solve this anyway, so I used the macro above. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: What am I doing wrong with this macro
    ... #ifdef DEBUG ... #define DEBUG_PRINT(level, format, a...) \ ... I didn't know you could use varargs type constructs in a macro. ...
    (comp.unix.solaris)
  • RE: Why does the date toggle between formats
    ... A great piece of reasoning OssieMac. ... don't revert to dates when I run the macro. ... tells it that the column contains DMY date format. ...
    (microsoft.public.excel.programming)