tccpp: Fix macro_is_equal

When tokens in macro definitions need cstr_buf inside get_tok_str,
the second might overwrite the first (happens when tokens are
multi-character non-identifiers, see testcase) in macro_is_equal,
failing to diagnose a difference.  Use a real local buffer.
This commit is contained in:
Michael Matz
2016-05-18 20:36:59 +02:00
parent 8080401ab0
commit 38e5cf0983
3 changed files with 10 additions and 4 deletions

3
tests/pp/16.c Normal file
View File

@ -0,0 +1,3 @@
/* The following should warn */
#define A ...
#define A <<=

2
tests/pp/16.expect Normal file
View File

@ -0,0 +1,2 @@
16.c:3: warning: A redefined