[comp.lang.c] Bugs in 'check' program

nick@ccicpg.UUCP (Nick Crossley) (02/27/88)

A few errors have been pointed out in my recently-posted 'check' program.
First, the shar I used was not the most portable, and you might have to edit
the tests on the line counts after each extract to use a numeric comparison
(-ne) instead of a string comparison (!=).  Thanks for noticing this to
ccicpg!uunet!rlgvax!dennis (Dennis.Bednar)

Second, the lexical analyser does not allow form-feeds in the source.  Change
line 40 of lex.l to add \f (and possibly \r) to the set of 'white-space'
characters.  Thanks to uunet!amdahl!nsc!taux01!taux02.taux01.UUCP!yuval
(Gideon Yuval) for this one.

Finally, my entry for 'silliest bug of the year' competition.  In the routine
'cwarn' in lex.l, I declare on on-stack (auto) char[120], and then about three
lines later, I call free on it!  This does not make the next malloc very happy.
Blame late-night last minute changes before posting!  This was noticed by
uunet!ubvax!pacbell!ptsfa!fdp (Frank Pedroni)

Nick Crossley
CCI, 9801 Muirlands, Irvine, CA 92718-2521, USA
Tel. (714) 458-7282
uucp: ...!uunet!ccicpg!nick