Re: 2.6.12-rc5-mm1: drivers/usb/atm/speedtch.c: gcc 2.95 compileerror

From: Andrew Morton
Date: Mon May 30 2005 - 03:10:13 EST


Duncan Sands <baldrick@xxxxxxx> wrote:
>
> Hi Adrian, it looks like gcc 2.95 doesn't like this kind of macro
>
> #define atm_info(instance, format, arg...) \
> atm_printk(KERN_INFO, instance , format , ## arg)
>
> being called with only two arguments. I don't know what
> the best fix is, but this does the trick:

Nope. There's a bug in gcc-2.95.x macro expansion, and here it bites us in
atm_printk():

printk(level "ATM dev %d: " format , (instance)->atm_dev->number, ## arg)

the workaround is to add a space before that final comma:

diff -puN drivers/usb/atm/usbatm.h~a drivers/usb/atm/usbatm.h
--- 25/drivers/usb/atm/usbatm.h~a 2005-05-30 01:02:51.000000000 -0700
+++ 25-akpm/drivers/usb/atm/usbatm.h 2005-05-30 01:03:08.000000000 -0700
@@ -62,7 +62,8 @@

/* FIXME: move to dev_* once ATM is driver model aware */
#define atm_printk(level, instance, format, arg...) \
- printk(level "ATM dev %d: " format , (instance)->atm_dev->number, ## arg)
+ printk(level "ATM dev %d: " format , \
+ (instance)->atm_dev->number , ## arg)

#define atm_err(instance, format, arg...) \
atm_printk(KERN_ERR, instance , format , ## arg)
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/