Prevent ## to appear at start or end of macro

This commit is contained in:
Thomas Preud'homme
2014-04-08 22:19:48 +08:00
parent 91d4db600b
commit a715d7143d
6 changed files with 20 additions and 4 deletions

View File

@ -0,0 +1,2 @@
#define paste(A,B) ##A B
paste(x,y)

View File

@ -0,0 +1 @@
65_macro_concat_start.c:1: error: '##' invalid at start of macro

View File

@ -0,0 +1,2 @@
#define paste(A,B) A B##
paste(x,y)

View File

@ -0,0 +1 @@
66_macro_concat_end.c:2: error: '##' invalid at end of macro

View File

@ -79,7 +79,9 @@ TESTS = \
61_undefined_enum.test \
62_enumerator_redefinition.test \
63_local_enumerator_redefinition.test \
64_macro_nesting.test
64_macro_nesting.test \
65_macro_concat_start.test \
66_macro_concat_end.test
# 30_hanoi.test -- seg fault in the code, gcc as well
# 34_array_assignment.test -- array assignment is not in C standard