Ethereal-dev: [Ethereal-dev] MSVC warning level

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Tue, 18 Nov 2003 01:18:46 +0100
Guy Harris wrote:

On Nov 17, 2003, at 12:26 PM, Ulf Lamping wrote:


If you didn't get a warning about "dlg_set_cancel()" in "gtk/capture_info_dlg.c", that must be because MSVC++ doesn't warn about functions with no prototype in scope - you have to include "dlg_utils.h" to get that declared.

If you didn't get warnings about "struct pcap_stat *" being used in the declaration of "capture()" without "struct pcap_stat" being defined, that's probably also because MSVC++ doesn't warn about that.

I think, I have to install a linux machine (presumably a Debian distro), and try to compile things, before committing to the CVS tree.


That might help somewhat, by adding more warnings - but it wouldn't have helped with the initialization checkin; somebody using the IRIX MIPS compiler had a problem with that one.



Hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm.
After having a look at the current MSVC warning configuration, I know why this happens.

A short note about the MSVC warnings:
MSVC knows about 5 warning levels: 0 (nothing) - 4 (very verbose)

As I'm writing portable code regularly, warning level 3 is a good tradeoff between too much warnings, and don't see the "important" ones.

So I had a look at the warning level that our current configuration uses , but only the default warning level is used. After looking at the MSVC documentation, the default warning level is set to 1, so "nearly nothing" will be warned!!!

After setting the warning level to 3, and recompiled *only* the gtk specific things, I got about 170 new warnings!!!!

I'm in doubt, if we should raise the warning level to 3, as this will give us *lot's* of warnings in a win32 generation (didn't tested this, but this must be thousands).

I really would like to have a clean build environment (this will make committing code much easier). So it might be a good idea to reduce current warnings (about 250 in the current CVS, with warning level 1!), raise warning level by one, reduce warnings again, until we reach warning level 3 with a reasonable number of warnings.

Regards, ULFL