aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/preprocessor12.c
diff options
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>2004-06-14 16:09:02 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:02:07 -0700
commit669244d22464b8e3af138f4df9e1f914f6feeffb (patch)
treee528bf56220f274d8fc5e16b274764812b32f114 /validation/preprocessor12.c
parent87ce1691126e447c34d16abc1624d6ca0e079a4a (diff)
downloadsparse-dev-669244d22464b8e3af138f4df9e1f914f6feeffb.tar.gz
[PATCH] lazy-copy macro expansion in pre-processing
This is almost a total rewrite of the macro expansion. It now does lazy-copy or the arguments, with the realization that if an argument only shows up once in the macro expansion (quite common), we don't need to allocate a new copy of the argument token stream, we can just insert it as-is. I hope it's reasonably clean and readable; review would be obviously welcome.
Diffstat (limited to 'validation/preprocessor12.c')
-rw-r--r--validation/preprocessor12.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/validation/preprocessor12.c b/validation/preprocessor12.c
new file mode 100644
index 00000000..385c1a7d
--- /dev/null
+++ b/validation/preprocessor12.c
@@ -0,0 +1,7 @@
+/*
+ * GNU kludge
+ */
+#define A(x,...) x,##__VA_ARGS__
+A(1)
+A(1,2)
+A(1,2,3)