Re: What am I doing wrong with this macro



John wrote:
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?

You are using a variadic macro which requires at least 3 parameters,
with only 2.

--
Ian Collins.
.



Relevant Pages

  • Re: ES format
    ... (snip regarding data types and format codes) ... > kind) of the list item is known at compile time. ... independent of the format descriptor or variable width. ...
    (comp.lang.fortran)
  • Re: What is wrong with this search for the character PV/PQ
    ... You are compiling fixed format source in which two lines extend beyond ... If you compile it for free format you have old style comments. ...
    (comp.lang.fortran)
  • Re: Calculating Difference In Time For Age
    ... Access will convert text hh:mm to a date format. ... > to a space delimited text file and the date imports as a date but not ... but now I feel guilty for breaking the Commandment:( ... >>> Compile on the menu bar, ...
    (microsoft.public.access.reports)
  • Re: lisp compiling to elf
    ... lisp compilers create elf format? ... produce an elf file then you could compile stand alone ... >>does anyone know of a lisp compiler that compiles ...
    (comp.lang.lisp)
  • Re: Emulating String.Format compile-time functionality
    ... format string, compile fails. ...
    (microsoft.public.dotnet.languages.csharp)