Subject: bin/6864: /bin/sh barfs on makelintstub for C library
To: None <gnats-bugs@gnats.netbsd.org>
From: None <Havard.Eidnes@runit.sintef.no>
List: netbsd-bugs
Date: 01/22/1999 17:18:59
>Number:         6864
>Category:       bin
>Synopsis:       /bin/sh barfs on makelintstub for C library
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 22 08:20:01 1999
>Last-Modified:
>Originator:     Havard Eidnes
>Organization:
	RUNIT AS
>Release:        NetBSD-current 19990120
>Environment:
	
NetBSD hugin.runit.sintef.no 1.3I NetBSD 1.3I (HUGIN) #3: Thu Jan 21 10:28:14 MET 1999     he@hugin.runit.sintef.no:/usr/src/sys/arch/i386/compile/HUGIN i386

>Description:
	As part of "make depend" in /usr/src/lib/libc, the shell
script /usr/src/lib/libc/sys/makelintstub is being run to create
LintSysNormal.c.  With the sources of 20 Jan 1999, the shell spits out
the error message

/usr/src/lib/libc/sys/makelintstub: arith: syntax error: "e" (where
the "e" is an "LF" symbol which I've not been able to cut/paste).

After some toying around with this, the following becomes apparent:

1) If the /bin/sh module parse.c is not compiled with optimization,
   the shell can handle the makelintstub invocation without problems.

2) If the two last files are removed from the makelintstub invocation,
   the fully optimized shell *can* handle the makelintstub call.

3) If only the last file is removed from the makelintstub command
   line, the fully optimized shell *cannot* handle the makelintstub
   call and bombs out with the above error message.
   
4) If the "cat of `here document'" in the header() function of the
   makelintstub is commented out or removed, the fully optimized shell
   can handle the invocation.

5) Only commenting out the call to the header() function in the script
   does not make the problem go away.

>How-To-Repeat:
	See above.   

>Fix:
	Sorry, don't know at the moment, and I will probably not be
able to look more at this today, so I submit this PR so that others
can air their ideas (if any).
>Audit-Trail:
>Unformatted: