sizeof ptrs,lint,etc

Guy Harris guy at rlgvax.UUCP
Thu Feb 7 03:31:28 AEST 1985


> I hate lint. All it ever does is complain about code that I know works.

Correction: all it ever does is complain about code that has worked so
far on the machines you've dealt with.

> I don't like casting funxions to (void). I don't like casting arguments
> to funxions. I don't like /*NOTREACHED*/. I do `if (exp) return exp;'
> to avoid the braces when I really mean `if (exp) { exp; return;}'
> I don't declare args as ptrs if I merely pass them on to another funxion.
> Even the UNIX REVIEW they gave away at Uniforum says that void just makes
> programs harder to read. What I do with lint is sweep it under the rug.

Fine.  Just don't go bitching to the manufacturer of a particular machine
if your code doesn't work on their machine.  I can thank "lint" for having
caught quite a number of *logic* errors in code which manifested themselves
as "lint" errors.  Lots of people have no trouble getting code to pass
"lint"; their code is more trustworthy.

>    The nil pointer in C *IS* a bit pattern of some size all zeros.

*******t.  Read K&R.  It makes no such categorical statement.  There is
no other authority who can make such a statement.

> This is not lisp.

Nor is it BCPL.  If you want BCPL, you know where to find it.

> If you want to generate a cell called `nil' & explicitly compare to
> `(??? *) &nil' be my guest. The syntax `if (p)' or `if (!p)' suits me
> just fine.

Bogus.  The syntax

	if (p)

is equivalent to

	if (p == 0)

which, if you read K&R, compares "p" with the bit pattern which represents
a null pointer.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.lang.c mailing list