Wireshark-dev: Re: [Wireshark-dev] Prevent compiler warnings by using "stop on warnings"/"treat
From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Tue, 20 Mar 2007 04:10:40 +0100
Luis Ontanon wrote:
the point is what kind of warnings can be cleaned up:
Well, do you mean "cannot be cleanup up" or "I'm too lazy to clean them up" ;-)
to fix "pointer arguments differ in signedness" for example  would be
a waste of time, as they are caused by guint8* used instaed of gchar*
on those systems (most) that treat char as an unsigned.
This is caused by random use of gchar/guint8 which is in effect not the same and BTW often done wrong.

What you're completely missing here is the additional information provided using the right types to new developers who take a look at the code.

I've "often" seen function declarations in the WS code that just uses the wrong types - in effect making a lot of dumb casts necessary.

Simply ignoring this "I know that this is the same" is at least ignorant to other developers having a look at the code.
But in order to follow that policy you'll have to fill the code with
"(void*)" casts (which is ugly) beacuse if you simply work on a system
that treats char as unsigned you can guess what would happen.
Fixing something like gchar*/guint8* problems by using a (void*) cast, well, actually makes things worse.
BTW
a more tolerant policy of no *more* warnings (than those we already
have) would be implementable by something like:

cp warnings last_warnings
make 2>&1 >warnings
diff -u warnings last_warnings | grep '^+' || warn_and_blame_last_commiter
While this might be a good start, having a "no warning" policy will work a lot better in the long run.

Regards, ULFL