[comp.unix.xenix] Help with SCO Xenix compiler bug affecting MH

allbery@nc386.uucp (Brandon S. Allbery) (07/28/89)

I'm having trouble with MH under SCO Xenix 2.2.1.  Specifically, I compile the
distribution with few problems (I'm used to hacking around gratuitous
Berkeleyisms by now), but when I run "repl" it gets a format compile error
from the default replcomps:

xrepl: "th))%(putaddr To: )_": format compile error - '>' expected.
xrepl:                     ^

(The underscore is at the string "\n" in the replcomps file.)

I had previously had this problem compiling MH 6.5 under Altos System V on
another system; since I don't exercise the mailer quite as heavily over there,
I just hacked around it.  However, when I compiled MH 6.6 over there I used
the "ncc" compiler that Altos now supplies (AT&T PCC; "cc" was and is the
Microsoft Xenix C compiler) and repl works fine now.  Also a reference point:
MH compiled and worked on ncoast (System III, soon to be defunct, which is why
I'm trying to recompile MH now!).  Anyway, it seems to be specific to MS C.

I've tried a number of things -- various -Zp? options, -CSOFF, varying -O?
levels from -Od on up, etc.; everything except -compat (since I don't really
want an 8088 executable!).  The only change was that -Zp2 causes all MH
programs to hang.

Has anyone brought up MH on a Xenix-ish system and can tell me how to hack
around the compiler bug?  I can't see anything offhand in the code which would
cause it to blow up.

Thanks in advance,
++Brandon
-- 
Brandon S. Allbery, moderator of comp.sources.misc	     allbery@NCoast.ORG
uunet!hal.cwru.edu!ncoast!allbery		    ncoast!allbery@hal.cwru.edu
   * This message brought to you courtesy the "Watcher" for the 4th NCoast *

dyer@spdcc.COM (Steve Dyer) (07/28/89)

In article <1989Jul28.002515.15344@nc386.uucp> allbery@nc386.UUCP (Brandon S. Allbery) writes:
>I'm having trouble with MH under SCO Xenix 2.2.1.  Specifically, I compile the
>distribution with few problems (I'm used to hacking around gratuitous
>Berkeleyisms by now), but when I run "repl" it gets a format compile error
>from the default replcomps:
>
>xrepl: "th))%(putaddr To: )_": format compile error - '>' expected.
>xrepl:                     ^

Yeah, I had this too.  Now, if I can only recreate what I did to fix it...
Let's see.  It was rather an obscure _difference_ in interpretation of the
language, not so much a bug...

Lemme dig...


Oh yes...in sbr/formatsbr.c, function 'normalize'

	static  normalize (cp)
	register char  *cp;
	{
    	register char  *dp;

    	for (dp = cp; *cp; cp++)
        	if (*cp != QUOTE)
            	*dp++ = *cp;
        	else
            	switch (*++cp) {
	#define grot(x) case 'x': *dp++ = '\x'; break;
                    	grot (b);
                    	grot (f);
                    	grot (n);
                    	grot (r);
                    	grot (t);

	/* **** */
	}

The macro "grot" won't work, because XENIX 386 cpp won't substitute
between single quoted character constants.  Rewrite it doing the
expansion yourself.

-- 
Steve Dyer
dyer@ursa-major.spdcc.com aka {ima,harvard,rayssd,linus,m2c}!spdcc!dyer
dyer@arktouros.mit.edu