aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@gcc.gnu.org>2003-06-01 14:55:15 -0400
committerDJ Delorie <dj@gcc.gnu.org>2003-06-01 14:55:15 -0400
commita7f36da37989019104e199ab78826bd929142818 (patch)
tree96669031e3b9ecf83c0e0e0b4fabc2f49db66e77 /gcc/cppmacro.c
parent8e2b6930e1d797225311e8774079519ae0043fb8 (diff)
downloadgcc-a7f36da37989019104e199ab78826bd929142818.zip
gcc-a7f36da37989019104e199ab78826bd929142818.tar.gz
gcc-a7f36da37989019104e199ab78826bd929142818.tar.bz2
cppmacro.c (warn_of_redefinition): Handle cases where the two definitions have different numbers of tokens.
* cppmacro.c (warn_of_redefinition): Handle cases where the two definitions have different numbers of tokens. * gcc.dg/cpp/redef3.c: New file. From-SVN: r67307
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r--gcc/cppmacro.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index f77f6b3..eba8c00 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -1275,10 +1275,12 @@ warn_of_redefinition (pfile, node, macro2)
if (CPP_OPTION (pfile, traditional))
return _cpp_expansions_different_trad (macro1, macro2);
- if (macro1->count == macro2->count)
- for (i = 0; i < macro1->count; i++)
- if (!_cpp_equiv_tokens (&macro1->exp.tokens[i], &macro2->exp.tokens[i]))
- return true;
+ if (macro1->count != macro2->count)
+ return true;
+
+ for (i = 0; i < macro1->count; i++)
+ if (!_cpp_equiv_tokens (&macro1->exp.tokens[i], &macro2->exp.tokens[i]))
+ return true;
return false;
}