awk bug

Eric K. Bustad ekb at ho7cad.ATT.COM
Thu Feb 11 00:50:18 AEST 1988


In article <3763 at megaron.arizona.edu>, rupley at arizona.edu (John Rupley) writes:
> This is a bit off the thread of the awk bug, but if the 3B20 can't 
> handle a NULL pointer in awk, how does it handle C code like:
> 	.
> 	cmpstr(strchr("abcdef", 'g'), "hijk")
> 	.
> cmpstr(s, t)
> char *s, *t;
> {
> 	[standard stuff]
> }

It handles C code like the above badly, because the code is basically
wrong.  C does not treat the NULL pointer as equivalent to a NULL string.

Any code that does this will happen to work on a VAX running UNIX, but
will fail on many more machines than just AT&T's 3B20.  I seem to recall
that on some machines you will get a memory access error if you dereference
a NULL pointer!  I rather will that the 3B20 did this, so that these
errors would have been caught much earlier.



More information about the Comp.bugs.sys5 mailing list