December 02, 2012 [Issue 9107] New: Value Range Analysis with uint and byte | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=9107 Summary: Value Range Analysis with uint and byte Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: diagnostic Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2012-12-02 12:24:19 PST --- Maybe this shows a problem of the Value Range Analysis, DMD 2.061alpha; void main(string[] args) { int a1 = 198 + args.length; // A run-time value. byte b1 = a1 % 200; // error, OK. uint a2 = 198 + args.length; ubyte b2 = a2 % 200; // no error, good. byte b3 = a2 % 200; // no error, bad. } test.d(3): Error: cannot implicitly convert expression (a1 % 200) of type int to byte -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 16, 2013 [Issue 9107] Value Range Analysis with uint and byte | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=9107 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yebblies@gmail.com --- Comment #1 from yebblies <yebblies@gmail.com> 2013-01-17 02:31:56 EST --- Range of a2 % 200: ( 0 to 200 ) Range of byte: ( -128 to 127 ) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation