Thread overview | ||||||
---|---|---|---|---|---|---|
|
September 01, 2009 [Issue 3280] New: comparing array length is wonky | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=3280 Summary: comparing array length is wonky Product: D Version: 2.031 Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: ellery-newcomer@utulsa.edu void main(){ string s; int a = s.length; assert(a == 0); assert(s.length == 0); assert(a == 0); assert(a > -1); assert(s.length > -1); //fails } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 02, 2009 [Issue 3280] comparing array length is wonky | ||||
---|---|---|---|---|
| ||||
Posted in reply to ellery-newcomer@utulsa.edu | http://d.puremagic.com/issues/show_bug.cgi?id=3280 Jarrett Billingsley <jarrett.billingsley@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |jarrett.billingsley@gmail.c | |om --- Comment #1 from Jarrett Billingsley <jarrett.billingsley@gmail.com> 2009-09-01 17:09:24 PDT --- Sorry, invalid. typeof(s.length) is unsigned, typeof(-1) is signed. The compiler should throw an error on the last assert, but doesn't. Instead, it casts -1 to size_t, resulting in something like "assert(s.length > 0xFFFFFFFF);" See bug 259. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 02, 2009 [Issue 3280] comparing array length is wonky | ||||
---|---|---|---|---|
| ||||
Posted in reply to ellery-newcomer@utulsa.edu | http://d.puremagic.com/issues/show_bug.cgi?id=3280 Jarrett Billingsley <jarrett.billingsley@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |INVALID --- Comment #2 from Jarrett Billingsley <jarrett.billingsley@gmail.com> 2009-09-01 17:09:39 PDT --- Oops -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 02, 2009 Re: [Issue 3280] comparing array length is wonky | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | d-bugmail@puremagic.com wrote:
> See bug 259.
>
Oh, gosh. I need multiple votes.
|
Copyright © 1999-2021 by the D Language Foundation