Re: Module compile problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2003-04-22 at 06:38, John Navil Joseph wrote:
> On Mon, Apr 21, 2003 at 02:37:12PM -0500, Curran, Dominic wrote:
> > mymod.c:128: parse error before `)'
> > 
> > 
> > Line 128 is:
> > 
> >   MSG("ENTER: mymod_open()\n");
> > 
> > However, if I change the line to take a parameter:
> > 
> >   MSG("ENTER: mymod_open(%i)\n", num);
> > 
> > then it compiles without error.
> > 


The extra argument (jiffies) seems to be what is confusing the compiler.
Possible solutions:

1) use a different version of gcc

2) Drop the toublesome argument, e.g.

#define MSG(string, args...) printk(KERN_INFO "MYMOD: "string, ##args)

3) Use two seperate printk's, e.g.

#define MSG(string, args...) do { \
  printk(KERN_INFO "MYMOD[%lu]: ", jiffies); \
  printk(string, ##args); \
} while(0)




--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux