On tor, 2008-05-15 at 14:44 -0600, Alex Rousskov wrote:

> Interesting bug. FWIW, it looks like g++ automatically detects the above
> error and says:
> warning: comparison between signed and unsigned integer expressions


Should depend on compiler options..


`-Wsign-compare'
     Warn when a comparison between signed and unsigned values could
     produce an incorrect result when the signed value is converted to
     unsigned.  This warning is also enabled by `-Wextra'; to get the
     other warnings of `-Wextra' without this warning, use `-Wextra
     -Wno-sign-compare'.

(from gcc 4.1.2 documentation)


I have this flag as a candidate warning flag in my build script, but not
activated as there is a bit of work to prune out the false alerts..

Regards
Henrik

Reply via email to