[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

user/1021: m4 aborts when expanding "unix" macro




>Number:         1021
>Category:       user
>Synopsis:       m4 aborts when expanding "unix" macro
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 22 09:30:02 MST 1999
>Last-Modified:
>Originator:     Christian Weisgerber
>Organization:
net
>Release:        2.6
>Environment:
	
	System      : OpenBSD 2.6
	Architecture: OpenBSD.sparc, OpenBSD.alpha
	Machine     : sparc, alpha

The problem is presumed to be generic to OpenBSD on all platforms.

>Description:

OpenBSD m4 aborts with "m4: eval: major botch" when expanding the
pre-defined "unix" macro.

Noticed when building sendmail.cf from the .mc file failed on host
spaghetti.unix-ag.uni-kl.de.
          ^^^^

Discussion: The man page says that "unix [is a] pre-defined macro
for testing the OS platform". Arguably, this can be interpreted
such that only ifdef(`unix',...) is required to work and that there
is no guarantee that "unix" can be expanded. However, this approach
is not very robust and diverges from common practice on other
platforms (GNU, Solaris, FreeBSD).

>How-To-Repeat:

echo unix | m4

>Fix:

This is from FreeBSD (rev 1.8->1.9 in their CVS).

--- m4/eval.c.orig	Wed Dec 22 15:01:56 1999
+++ m4/eval.c	Wed Dec 22 17:13:08 1999
@@ -378,6 +378,10 @@
 				dodefn(argv[n]);
 		break;
 
+	case MACRTYPE:
+		pbstr("");
+		break;
+
 	default:
 		errx(1, "eval: major botch.");
 		break;

>Audit-Trail:
>Unformatted: