changeset 84:7e4723d34248

Complain only about non-identical redefinitions of macros.
author David A. Holland
date Mon, 10 Jun 2013 21:34:59 -0400
parents 3e505c16b0b0
children c91dc1315745
files macro.c
diffstat 1 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/macro.c	Mon Jun 10 21:33:31 2013 -0400
+++ b/macro.c	Mon Jun 10 21:34:59 2013 -0400
@@ -445,18 +445,25 @@
 	if (oldm != NULL) {
 		ok = macro_eq(m, oldm);
 		if (ok) {
+			/* in traditional cpp this is silent */
+			//complain(&m->defplace,
+			//	 "Warning: redefinition of %s", m->name);
+			//complain(&oldm->defplace,
+			//	 "Previous definition was here");
+			//if (mode.werror) {
+			//	complain_fail();
+			//}
+		} else {
 			complain(&m->defplace,
-				 "Warning: redefinition of %s", m->name);
+				 "Warning: non-identical redefinition of %s",
+				 m->name);
+			complain(&oldm->defplace,
+				 "Previous definition was here");
+			/* in traditional cpp this is not fatal */
 			if (mode.werror) {
 				complain_fail();
 			}
-		} else {
-			complain(&m->defplace,
-				 "Redefinition of %s is not identical",
-				 m->name);
-			complain_fail();
 		}
-		complain(&oldm->defplace, "Previous definition was here");
 		macro_destroy(m);
 		return;
 	}