Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!genrad!panda!talcott!harvard!seismo!mcvax!boring!steven From: steven@boring.uucp (Steven Pemberton) Newsgroups: net.sources Subject: Re: Using identifiers with more than 7 chars. #$%@ Message-ID: <6809@boring.UUCP> Date: Wed, 5-Mar-86 08:25:35 EST Article-I.D.: boring.6809 Posted: Wed Mar 5 08:25:35 1986 Date-Received: Fri, 7-Mar-86 08:26:07 EST References: <526@dsi1.UUCP> Reply-To: steven@mcvax.UUCP (Steven Pemberton) Distribution: net Organization: CWI, Amsterdam Lines: 93 Apparently-To: rnews@mcvax In article <526@dsi1.UUCP> ron@dsi1.UUCP (Ron Flax) writes: > I wish that the people that post sources to the net would try to keep > in mind that some of us have compilers that can't swollow indentifiers > that are longer than seven (7) characters long. The problem is that the compilers don't have a switch to ask them to check for such limits. Even if you're trying to write portable programs, it is all too easy to use identifiers that don't differ over the right number of characters. Here then is a reposting of three little shell command files I wrote (only tried under BSD: they use the nm(1) command, and depend on its output format) to check different limits: 8limit - all identifiers used in an object module differ over the first 8 characters 7limit - all external identifiers in a binary differ over the first 7 characters 6limit - all externals in a binary differ in the first 6 characters case-insensitively (some people really have this limit!) Note carefully that 8limit takes a list of *.o files, while 6/7limit take an executable. Steven Pemberton, CWI, Amsterdam; steven@mcvax.uucp : ---------------------- CUT HERE ------------------------------- : This is a shar archive. Extract with sh, not csh. : The rest of this file will extract: : 6limit 7limit 8limit echo x - 6limit sed -e 's/^X//' <<'Bye-Bye' >6limit X: Check externals differ case-insensitively over first 6 chars Xcase $# in X1) ;; X*) echo Usage: $0 executable-file ; exit 1;; Xesac X Xtrap 'rm -f /tmp/lim1.$$ /tmp/lim2.$$; exit 1' 1 2 15 Xnm -g $1 | sed "s/^............//" >/tmp/lim1.$$ Xsed "s/^\(......\).*/\1/" /tmp/lim2.$$ Xif test -s /tmp/lim2.$$ Xthen X echo The following externals don\'t differ in the first 6 characters: X sh /tmp/lim2.$$ Xelse X echo All externals differ in the first 6 characters Xfi Xrm -f /tmp/lim1.$$ /tmp/lim2.$$ Bye-Bye echo x - 7limit sed -e 's/^X//' <<'Bye-Bye' >7limit X: Check externals differ over first 7 chars Xcase $# in X1) ;; X*) echo Usage: $0 executable-file ; exit 1;; Xesac X Xtrap 'rm -f /tmp/lim1.$$ /tmp/lim2.$$; exit 1' 1 2 15 Xnm -g $1 | sed "s/^............//" >/tmp/lim1.$$ Xsed "s/^\(.......\).*/\1/" /tmp/lim2.$$ Xif test -s /tmp/lim2.$$ Xthen X echo The following externals don\'t differ in the first 7 characters: X sh /tmp/lim2.$$ Xelse X echo All externals differ in the first 7 characters Xfi Xrm -f /tmp/lim1.$$ /tmp/lim2.$$ Bye-Bye echo x - 8limit sed -e 's/^X//' <<'Bye-Bye' >8limit X: Check names differ over first 8 chars Xcase $# in X0) echo Usage: $0 object-files ... ; exit 1;; X*) ;; Xesac X Xtrap 'rm -f /tmp/lim1.$$ /tmp/lim2.$$; exit 1' 1 2 15 Xfor f Xdo X echo $f: X nm $f | sed "s/^...........//" | grep "^_" | sed "s/^_//" >/tmp/lim1.$$ X sed "s/^\(........\).*/\1/" /tmp/lim2.$$ X if test -s /tmp/lim2.$$ X then X echo In $f the following don\'t differ in the first 8 characters: X sh /tmp/lim2.$$ X fi Xdone Xrm -f /tmp/lim1.$$ /tmp/lim2.$$ Bye-Bye exit 0