[openib-general] Re: at won't compile with gcc-2.95

James Lentini jlentini at netapp.com
Thu Sep 1 13:06:19 PDT 2005



On Thu, 1 Sep 2005, Hal Rosenstock wrote:

> Hi James,
> 
> On Thu, 2005-09-01 at 14:06, James Lentini wrote:
> > I think you want
> > 
> > #define WARN(fmt, ...) \
> > 	printk("ib_at: %s: " fmt "\n", __FUNCTION__, __VA_ARGS__)
> > 
> > (note that I've removed the ";") but I don't have gcc 2.95 to test it.
> 
> Did this work for you ? 

As I said, I don't have gcc 2.95 installed so I didn't test it. 

We use a similar definition in uDAPL, something along the lines of

#define foo(...) bar(__VA_ARGS__)

I bet the initial fmt parameter is confusing it. 

In kDAPL, the debug print function is defined as static inline 
function when debugging is on and an empty macro when it is 
off. That might be easier than fighting with the C preprocessor.

> I get:
> drivers/infiniband/core/at_priv.h:140:78: warning: __VA_ARGS__ can only
> appear in the expansion of a C99 variadic macro
> followed by other errors as a result of this.
> 
> -- Hal
> 



More information about the general mailing list