+2003-05-29 DJ Delorie <dj@redhat.com>
+
+ * cppmacro.c (warn_of_redefinition): Handle cases where the two
+ definitions have different numbers of tokens.
+
2003-06-01 Andreas Jaeger <aj@suse.de>
* gen-protos.c (main): Readd unused attribute for argc.
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 (¯o1->exp.tokens[i], ¯o2->exp.tokens[i]))
- return true;
+ if (macro1->count != macro2->count)
+ return true;
+
+ for (i = 0; i < macro1->count; i++)
+ if (!_cpp_equiv_tokens (¯o1->exp.tokens[i], ¯o2->exp.tokens[i]))
+ return true;
return false;
}
+2003-06-01 Loren James Rittle <ljrittle@acm.org>
+
+ * gcc.dg/cpp/redef3.c: New file.
+
2003-06-01 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/i386-loop-3.c: New test.
--- /dev/null
+/* Test for redefining macros with mismatch token count (and the oddity). */
+
+/* { dg-do preprocess } */
+/* { dg-options "-DC -DD=1 -DE" } */
+
+#define A
+#define A 1
+#define B 2 3
+#define B 2
+#define C 1
+#define D 1 2
+#define E
+
+/* { dg-warning "redefined" "redef A" { target *-*-* } 7 }
+ { dg-warning "redefined" "redef B" { target *-*-* } 9 }
+ { dg-warning "redefined" "redef D" { target *-*-* } 11 }
+ { dg-warning "redefined" "redef E" { target *-*-* } 12 }
+ { dg-warning "previous" "prev def A" { target *-*-* } 6 }
+ { dg-warning "previous" "prev def B" { target *-*-* } 8 }
+ { dg-warning "previous" "prev def D/E" { target *-*-* } 0 }
+*/