http://d.puremagic.com/issues/show_bug.cgi?id=1977


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
            Summary|integral arithmetic         |Relax warnings for implicit
                   |operation only on int?      |narrowing conversions caused
                   |                            |by promotions




------- Comment #6 from [EMAIL PROTECTED]  2008-11-22 09:01 -------
(In reply to comment #4)
> It's not ridiculous at all.  The compiler cannot tell what values 
> will be possibly passed to f, and the range of byte and short are 
> sufficiently small to make overflow as frequent as it is confusing 
> and undesirable.

I disagree:
- Read comment 3.  How can adding (or even subtracting, multiplying or
dividing) two numbers in the range [-128, 127] possibly produce a value outside
the range [-32768, 32767]?

- If you're using (u)byte/(u)short, it follows that you should know what you're
doing.  Especially if you're doing it in an initialiser of something declared
explicitly as one of these types, in which case you've shown that you know what
you're doing.

- It happens even in the case of bitwise operations (&, |, ^, >>, >>>, but
strangely not ~), by which overflow is impossible.  It might be sensible for
<<, but no more.


-- 

Reply via email to