aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/preprocessor6.c
diff options
authorLinus Torvalds <torvalds@home.osdl.org>2003-08-02 17:47:26 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:01:00 -0700
commit6dfe359777b8bcb2c504f01bac5b9b4687aaaf73 (patch)
treecb8ce7bb8204d063758c5b1d7a69f98e131485df /validation/preprocessor6.c
parent353456dc28f39b38715d341347c3c57103839e04 (diff)
downloadsparse-dev-6dfe359777b8bcb2c504f01bac5b9b4687aaaf73.tar.gz
Add a test for '##' handling from the kernel sources,
which we get badly wrong (it's used by pcinames.c).
Diffstat (limited to 'validation/preprocessor6.c')
-rw-r--r--validation/preprocessor6.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/validation/preprocessor6.c b/validation/preprocessor6.c
new file mode 100644
index 00000000..3f9674ec
--- /dev/null
+++ b/validation/preprocessor6.c
@@ -0,0 +1,25 @@
+/*
+ * We get '##' wrong for the kernel.
+ *
+ * It could possibly be argued that the kernel usage
+ * is undefined (since the different sides of the '##'
+ * are not proper tokens), but that's probably a load
+ * of bull. We should just try to do it right.
+ *
+ * This _should_ result in
+ *
+ * static char __vendorstr_003d[] __devinitdata = "Lockheed Martin-Marietta Corp";
+ *
+ * but we break up the "003d" into two tokens ('003' and 'd')
+ * and then we also put the 'o' marker to mark the token 003
+ * as an octal number, so we end up with
+ *
+ * static char __vendorstr_o03 d [ ] __devinitdata = "Lockheed Martin-Marietta Corp";
+ *
+ * which doesn't work, of course.
+ */
+
+#define VENDOR( vendor, name ) \
+ static char __vendorstr_##vendor[] __devinitdata = name;
+VENDOR(003d,"Lockheed Martin-Marietta Corp")
+