February 05, 2011 [Issue 5528] New: Some integer interval analysis to avoid some casts | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=5528 Summary: Some integer interval analysis to avoid some casts Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2011-02-05 06:07:05 PST --- This little D2 program shows code that's correct: void main() { uint i = 10; ubyte x1 = i % ubyte.max; ulong l = 10; uint x2 = l % uint.max; } But dmd 2.051 asks for casts: test.d(3): Error: cannot implicitly convert expression (i % 255u) of type uint to ubyte test.d(5): Error: cannot implicitly convert expression (l % 4294967295LU) of type ulong to uint I think those casts are not necessary, so I'd like dmd to avoid asking for casts in such situations. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 16, 2011 [Issue 5528] Some integer interval analysis to avoid some casts | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5528 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies@gmail.com Resolution| |DUPLICATE --- Comment #1 from yebblies <yebblies@gmail.com> 2011-06-16 01:01:05 PDT --- *** This issue has been marked as a duplicate of issue 3147 *** -- 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