[Issue 1977] integral arithmetic operation only on int?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 22 04:25:20 PST 2008


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


andrei at metalanguage.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #4 from andrei at metalanguage.com  2008-11-22 06:25 -------
(In reply to comment #1)
> It's as documented.  Integral types smaller than int are automagically
> converted to int when performing arithmetic on them.
> 
> But it is somewhat ridiculous that it should still throw the warning in such
> cases as this.

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.

The community has insisted for a long time to tighten integral operations, and
now that it's happening, the tightening is reported as a bug :o).


-- 



More information about the Digitalmars-d-bugs mailing list