diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2002-06-10 06:03:13 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-06-10 06:03:13 +0000 |
commit | 6618c5d49d3dfb1f4a4c55026ddcba8a3059289b (patch) | |
tree | adbb48f5611c4e938179b3f12970a0c7bef07ce1 /gcc/cppmacro.c | |
parent | 36d010cabfac9532fcd0bc5e52ea2b2bf941e4ba (diff) | |
download | gcc-6618c5d49d3dfb1f4a4c55026ddcba8a3059289b.zip gcc-6618c5d49d3dfb1f4a4c55026ddcba8a3059289b.tar.gz gcc-6618c5d49d3dfb1f4a4c55026ddcba8a3059289b.tar.bz2 |
cpphash.h (struct cpp_macro): Put comments on their own lines.
* cpphash.h (struct cpp_macro): Put comments on their own lines.
(_cpp_expansions_different_trad): New.
* cppmacro.c (warn_of_redefinition): Fix for traditional case.
* cpptrad.c (canonicalize_text): New.
(scan_out_logical_line): Handle no arguments correctly.
(save_replacement_text): Commit memory when finished.
(_cpp_expansions_different_trad): New.
From-SVN: r54432
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r-- | gcc/cppmacro.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index d517948..a9ca6cf 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -1176,9 +1176,9 @@ warn_of_redefinition (pfile, node, macro2) definitions are the same. (6.10.3 paragraph 2). */ macro1 = node->value.macro; - /* The quick failures. */ - if (macro1->count != macro2->count - || macro1->paramc != macro2->paramc + /* Don't check count here as it can be different in valid + traditional redefinitions with just whitespace differences. */ + if (macro1->paramc != macro2->paramc || macro1->fun_like != macro2->fun_like || macro1->variadic != macro2->variadic) return true; @@ -1190,11 +1190,12 @@ warn_of_redefinition (pfile, node, macro2) /* Check the replacement text or tokens. */ if (CPP_OPTION (pfile, traditional)) - return memcmp (macro1->exp.text, macro2->exp.text, macro1->count); + return _cpp_expansions_different_trad (macro1, macro2); - for (i = 0; i < macro1->count; i++) - if (!_cpp_equiv_tokens (¯o1->exp.tokens[i], ¯o2->exp.tokens[i])) - return true; + if (macro1->count == macro2->count) + for (i = 0; i < macro1->count; i++) + if (!_cpp_equiv_tokens (¯o1->exp.tokens[i], ¯o2->exp.tokens[i])) + return true; return false; } |