Ethereal-dev: [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: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 5 Jan 2004 19:33:44 -0800

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).

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++.