hoc

rob at alice.UUCP rob at alice.UUCP
Mon Jul 11 03:19:52 AEST 1988


Someone complained about hoc dumping core.  It indeed has a bug that only
shows up on some machines.  The yacc source uses the routine code(), which
returns a structure.  If your compiler does something special with
structure-valued functions, and I think the 3B2 compiler does, you can
get a horrible error because the calling code doesn't follow the right
protocol.  The obvious, correct fix is to declare code() correctly in
the beginning of the grammar file.  Note that casting it to (void) doesn't 
work, which is one of the reasons I despise lint -- it encourages you
to stick (void) casts everwhere) -- enough that this bug happened.
s2/)//

-Rob Pike



More information about the Comp.unix.questions mailing list