Fix preprocessor concat with empty arg

This commit is contained in:
Thomas Preud'homme
2014-04-12 12:00:13 +08:00
parent 9714d2e75f
commit 6e56bb387d
5 changed files with 56 additions and 6 deletions

View File

@ -0,0 +1,14 @@
#include <stdio.h>
#define P(A,B) A ## B ; bob
#define Q(A,B) A ## B+
int main(void)
{
int bob, jim = 21;
bob = P(jim,) *= 2;
printf("jim: %d, bob: %d\n", jim, bob);
jim = 60 Q(+,)3;
printf("jim: %d\n", jim);
return 0;
}

View File

@ -0,0 +1,2 @@
jim: 21, bob: 42
jim: 63

View File

@ -81,7 +81,8 @@ TESTS = \
63_local_enumerator_redefinition.test \
64_macro_nesting.test \
65_macro_concat_start.test \
66_macro_concat_end.test
66_macro_concat_end.test \
67_macro_concat.test
# 30_hanoi.test -- seg fault in the code, gcc as well
# 34_array_assignment.test -- array assignment is not in C standard