[Issue 1977] New: integral arithmetic operation only on int?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 7 14:06:15 PDT 2008


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

           Summary: integral arithmetic operation only on int?
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: someanon at yahoo.com


There's no arithmetic operation for byte? everything has to be cast to int (and
back)?

I try to use the '-w' switch to clear all warnings, but this one isn't
necessary:

$ cat bytewarn.d

byte f(byte i) {
  byte t = 1;
  byte o = t - i;
  return o;
}

$ dmd -w -c bytewarn.d
warning - bytewarn.d(4): Error: implicit conversion of expression (cast(int)t -
cast(int)i) of type int to byte can cause loss of data


-- 



More information about the Digitalmars-d-bugs mailing list