diff options
| author | Michael Matz <matz@suse.de> | 2016-05-18 20:36:59 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2016-12-15 17:47:05 +0100 |
| commit | 38e5cf0983e02b2fc77d77adfd9b937768dfcfd5 (patch) | |
| tree | fd09ead1876e9bc967ebf71698449fe759f395e7 /tests/pp | |
| parent | 8080401ab00aea30a1df70e36b55d3ff745d00c8 (diff) | |
| download | tinycc-38e5cf0983e02b2fc77d77adfd9b937768dfcfd5.tar.gz tinycc-38e5cf0983e02b2fc77d77adfd9b937768dfcfd5.tar.bz2 | |
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.
Diffstat (limited to 'tests/pp')
| -rw-r--r-- | tests/pp/16.c | 3 | ||||
| -rw-r--r-- | tests/pp/16.expect | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/pp/16.c b/tests/pp/16.c new file mode 100644 index 0000000..8b5b642 --- /dev/null +++ b/tests/pp/16.c @@ -0,0 +1,3 @@ +/* The following should warn */ +#define A ... +#define A <<= diff --git a/tests/pp/16.expect b/tests/pp/16.expect new file mode 100644 index 0000000..695d6d4 --- /dev/null +++ b/tests/pp/16.expect @@ -0,0 +1,2 @@ + +16.c:3: warning: A redefined |
