lkml.org 
[lkml]   [1999]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Buggy vararg macros
From
Date
Andreas Bombe <andreas.bombe@munich.netsurf.de> writes:

|> GCC (more specifically its preprocessor) allows us to use vararg macros
|> and there are a number of those used in the kernel sources. They work,
|> but they rely on current behaviour of gcc because of missing
|> whitespace.
|>
|> Example of how it should be done:
|> #define MY_PRINTK(fmt, args...) printk(KERN_INFO fmt , ## args)
|>
|> Currently the '##' discards the characters up to a preceding macro
|> argument, but it might change to a more clean behaviour of deleting the
|> whole token preceding it. This would include the macro argument if
|> there is no space between it and the comma.

??? The comma *is* a complete token. So the future change (which won't
happen, btw, since C9x has a different way to implement vararg macros)
would make the macros work as expected independent of whitespace. And, of
course, the whole thing is only relevant when the variable part is empty,
but i don't think the macros are currently ever used this way.

Andreas.

--
Andreas Schwab "And now for something
schwab@suse.de completely different."
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

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

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.036 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site