October 10, 2011 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 Christian Kamm <kamm-removethis@incasoftware.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kamm-removethis@incasoftwar | |e.de --- Comment #20 from Christian Kamm <kamm-removethis@incasoftware.de> 2011-10-10 08:58:59 PDT --- See https://github.com/D-Programming-Language/dmd/pull/119 https://github.com/D-Programming-Language/dmd/pull/444 for two possible fixes. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 25, 2011 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 bearophile_hugs@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs@eml.cc --- Comment #21 from bearophile_hugs@eml.cc 2011-11-24 17:45:34 PST --- See: https://github.com/D-Programming-Language/dmd/commit/4536fd5e3102fcea168660e9c4d2a2c80d50e7f5 But druntime and Phobos will probably need some changes. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 25, 2011 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 --- Comment #22 from bearophile_hugs@eml.cc 2011-11-24 19:25:19 PST --- (In reply to comment #21) > But druntime and Phobos will probably need some changes. Keeping this as a warning in the current compiler, and turn it into an (deprecated) error in the next DMD version, will probably allow to update druntime and Phobos. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 25, 2011 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 --- Comment #23 from bearophile_hugs@eml.cc 2011-11-25 02:32:32 PST --- I think Walter is willing to accept that patch if someone improves the patch to remove some of its false positives. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 25, 2011 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 --- Comment #24 from Don <clugdbug@yahoo.com.au> 2011-11-25 04:05:29 PST --- It seems wrong to me that: if (-1 < 2u) {...} fails to compile. Both are in the range -int.max .. int.max, so they can safely be compared using signed comparison. The problems with mixed sign are when one operand can be in the range -int.max..0 and the other can be in the range int.max+1u..uint.max. If at least one of the operands is in the polysemous range 0..int.max, there should be no problem. But, the patch as it stands allows a polysemous-ranged int to be compared with a uint, but does not allow a polysemous-range uint to be compared with an int. At present the spec doesn't give any reason for unsigned to be treated from signed. The problem is the silly C promotion rule that converts both operands to unsigned (instead, it should generate an error). In any existing C code that works, it works because the signed operand is in the polysemous range. Of course there could be code which relies on (-1<2u) being false. But surely such code is broken. Do we really need to retain backwards compatibility with broken C code? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 25, 2011 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 --- Comment #25 from bearophile_hugs@eml.cc 2011-11-25 04:26:23 PST --- (In reply to comment #24) Thank you Don. > Of course there could be code which relies on (-1<2u) being false. > But surely such code is broken. I don't like this is in D. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 20, 2012 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 Jesse Phillips <Jesse.K.Phillips+D@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Jesse.K.Phillips+D@gmail.co | |m Target Milestone|--- |2.059 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 05, 2013 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 Denis Shelomovskij <verylonglogin.reg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |verylonglogin.reg@gmail.com --- Comment #26 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-03-05 10:44:52 MSK --- Issue state: dmd pull #444 https://github.com/D-Programming-Language/dmd/pull/444 was merged, then #ifdef'd out as it was "too disruptive" in https://github.com/D-Programming-Language/dmd/commit/52d8c150ecfbe2cad6672f50094a6ff1230e72e3 then completely removed in dmd pull #1611 https://github.com/D-Programming-Language/dmd/pull/1611 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 07, 2013 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |WONTFIX --- Comment #27 from Walter Bright <bugzilla@digitalmars.com> 2013-04-07 01:27:07 PDT --- I think we're going to have to give up on this one. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 07, 2013 [Issue 259] Comparing signed to unsigned does not generate an error | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=259 --- Comment #28 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-04-07 20:42:55 MSD --- (In reply to comment #27) > I think we're going to have to give up on this one. Not being able to at least highlight signed to unsigned comparisons in a program is a major lack of functionality. IMHO this is why enhancement Issue 9811 matters as it is the place where we can forget about "disruptiveness" and "is it always and error" questions. -- 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