Re: Module compile problem

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

 



On Tue, 2003-04-22 at 05:57, Steffen Menne wrote:
> Good Morning!
> >
> > Am Dienstag, 22. April 2003 12:38 schrieb John Navil Joseph:
> > > 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.
> > >
> > > hi,
> > >
> > > i tried to compile ur program in user space by converting the kernel
> > > jargon to user space stuff.
> > >
> > > #define KERN_INFO "<6>"
> > > #define jiffies 8345734
> > > #define printk printf
> > >
> > > #define MSG(string, args...)  printk(KERN_INFO "MYMOD[%lu]: "string,
> > > jiffies, ##args)
> >
> I've got another questions: What does ##args mean? I looked for it in my C
> reference, but I couldn't find it. Of course I know that args is a
> arameter for the MSG - macro, but what do the ## do?

It is a gcc extension.  See gcc's info docs:

  gcc -> C Extensions -> Variadic Macros

Basicaly it is refering to all the tokens represented by 'args' in
MDG(string, args...) with the added helpfull feature of removing the
preceeding "," if there are no 'args'.




--
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