Subject: Re: C vs. prototypes (was: Problems with gdb under NetBSD 1.0 )
To: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
From: Greg A. Woods <email@example.com>
Date: 12/16/1994 11:45:37
[ On Fri, December 16, 1994 at 07:45:24 (-0500), der Mouse wrote: ]
> Subject: Re: C vs. prototypes (was: Problems with gdb under NetBSD 1.0 )
> (No, instead it produces reams of meaningless messages you can't shut
> off and have to wade through to find the _real_ message or two.)
Well some of us learned to write code that linted cleanly (though rarely
on the first pass! ;-)
It is possible to shut lint up where you're supposed to be able to.
> At least one does, if you know how to ask it. I use gcc -Werror -W
> -Wall -Wpointer-arith -Wcast-qual -Wwrite-strings -Wstrict-prototypes
> -Wmissing-prototypes, and I get cross-file checks because all routines
> visible across files must have prototypes in scope everywhere they
> appear. I find this invocation of gcc to be better than lint; it
> doesn't produce reams of warnings I have to ignore and produces some
> warnings I have never gotten from any lint I've ever seen.
As for warnings you've never seen from lint, perhaps you should talk to
Steve Johnson about all the stuff he wanted to put in lint, but wasn't
allowed to by AT&T, and how he feels about any ANSI C's ability to do
I personally just fall back on Pike's assertion that the lint checking
tool should check for lint, and the compiler should compile, and never
the two should meet.
I just wish lint messages from the AT&T versions matched the output
format of compiler messages, instead of the silly summaries it tries to
generate that are entierly un-parsable.
> >> Actually, I'd live with prototypes *iff* the automatic type coercion
> >> was not available....
> gcc -Wconversion is exactly what you want here, I believe:
> Warn if a prototype causes a type conversion that is
> different from what would happen to the same argument
> in the absence of a prototype. [...]
> Not that I wish to sound like a gcc apologist; I don't like FSF stuff
> in general. But in my opinion gcc is the one case where the complete
> lack of anything anywhere nearly as good outweighs the disadvantages.
And true enough, I don't want to completely disown gcc either, as
without it (or something at least as good) we wouldn't have a portable,
free, operating system yet.
Greg A. Woods
+1 416 443-1734 VE3TCP robohack!woods
Planix, Inc. <firstname.lastname@example.org>; UniForum Canada <email@example.com>