Ethereal-dev: Re: [Ethereal-dev] Warnings for narrowing conversions

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, 06 Jan 2004 20:45:28 +0100
Guy Harris wrote:


On Jan 5, 2004, at 1:04 PM, Ulf Lamping wrote:

ulfl        2004/01/05 15:04:42 CST

  Modified files:
    .                    config.nmake
  Log:
  switched to MSVC warning level 3 and
  default is winpcap version 3 now


Several of the warnings revealed real bugs (most of which were the assignment of the result of "tvb_get_ntohs()" or "tvb_get_letohs()" to a "guint8"); I've checked in fixes for the ones I found (some others require some more thinking; others were warnings for problems that can't occur, so the cast is the right way to handle that).

Will you keep on tracking the problems I (my MSVC compiler) found?


It's too bad that there's no "-Wimplicit-narrowing-cast" option to GCC; if there were, we could add that to our list of GCC warnings and get warnings for those cases with GCC as well as with MSVC++.

Well, as I have changed the default to MSVC warning level 3 right now, at least we get warnings on the win32 platform now.


FYI: I don't tend to raise the MSVC warning level to 4, as my experience is, that the warnings at that level doesn't really give useful information.

Regards, ULFL