Subject: Re: usr.bin/make
To: Max Okumoto <email@example.com>
From: Christos Zoulas <firstname.lastname@example.org>
Date: 02/01/2005 08:38:54
On Feb 1, 4:24am, email@example.com (Max Okumoto) wrote:
-- Subject: Re: usr.bin/make
| >In article <firstname.lastname@example.org>,
| >Max Okumoto <email@example.com> wrote:
| >>The following two attachments are a script that and the diffs
| >>generated by that script. The script does the following:
| >> * removes spaces between function name and parameters.
| >> funcname (1, 2, 3) => funcname(1, 2, 3)
| >that is fine.
| >> * removes (void) from in front of unsed return
| >> values of functions.
| >> (void)funcname(1, 2) => funcname(1, 2)
| >that breaks lint. Why do you want to do it?
| 1. It would make the code more consistant.
| % cd usr.bin/make
| % grep printf *.c
| % grep close *.c
Well, I would prefer to add the (void) casts to the rest.
| 2. It clutters the code without adding much
It tells lint that you knowingly ignore the value because
you don't care.
| 3. Does anyone really still use lint? Compilers
| today generate better warnings and most don't
| warn about unused return values.
We do, and obviously you haven't.
Well, show me a compiler that I can use in NetBSD
that can do what lint does:
1. Warn about non-portable constructs. For example
what is the type of the result of:
unsigned long b;
c = a << b;
Or it is not portable to do:
a >> b;
Or warn about non-portable pointer casts.
2. They only produce warnings for a single compilation
unit. They don't check for consistency between
3. They don't warn about implicit promotions, or if assignments
that lose accuracy because of narrowing of types.
Just to mention a few.
| 4. We are removing casting to '(void)' from our
| code base :-)
More power to you.
| PS. I looked at /usr/share/misc/style and there
| is confusion there too :-)
| printf(...) without a cast
| (void)fprintf(...) with a cast
We should fix that.