Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Feb 1997 19:38:57 +0100
From:      Eivind Eklund <eivind@dimaga.com>
To:        joelh@gnu.ai.mit.edu
Cc:        wollman@lcs.mit.edu, chat@freebsd.org
Subject:   Re: cvs commit: CVSROOT avail
Message-ID:  <3.0.32.19970209193855.00ab2b40@dimaga.com>

next in thread | raw e-mail | index | archive | help

At 01:12 PM 2/9/97 -0500, Joel Ray Holveck wrote:
[Correct description of prototype-issues with K&R style definitions removed]
>
>Is this incorrect?

No, it is correct.  However, unless everybody is _very_ careful, it is
likely that we end up with some functions being defined somewhere their
prototype is not in scope.  This can cause weirdness.

>I have to agree with you here.  Using NULL makes it clear that you are
>referring to a pointer.  It's kind of like using `null' or `not' in
>Lisp.
>
>Moreover, assuming the OS vendor (I know we're mainly talking FreeBSD
>here, but no reason not to encourage portable code writing) has
>properly #defined NULL as ((void*)0) on compilers which grok the void*
>type, and ((char*)0) on the others, then it will be properly handled
>in a prototypeless call without a cast on machines where
>sizeof(int) != sizeof(void*).  (If I recall correctly, pointer types
>*never* have default promotions, so machines which have different
>pointer formats for different types will still die, but that's another
>issue.)

This is also correct :)

> >> 11) Don't use in lint(1) ``control comments''.  Nobody uses lint.
> > I've just turned into "nobody". :)
>
>Although lint was handy in earlier days, I find that most compilers'
>warnings are better now.  I typically use `gcc -Wall -W
>-Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion
>-Wpointer-arith -Wshadow -Wwrite-strings' in my code during
>development, and it helps me catch more bonehead mistakes than lint
>ever did.
>
>If you use lint, I have no problems seeing control comments now and
>again.  But, to quote rms, "Don't make your code ugly to placate
>lint."

I'm using a very powerful commerical lint called flexelint -
http://www.gimpel.com for more info.
It is _way_ better on error reporting than gcc.  If gcc had been good
enough, how come machine/endian.h still has a non-paranthesed expression
for NTOHL, just inviting the users to create bugs? :)
(I'll see if I can get at least all the header files fixed reasonably soon
- but I've got some other tasks to finish first)



Eivind Eklund  perhaps@yes.no  http://maybe.yes.no/perhaps/
eivind@freebsd.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.32.19970209193855.00ab2b40>