Thread overview | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 21, 2016 [Issue 16997] Real-life evidence for integer promotion of unary minus creating bugs when porting C code | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 Ketmar Dark <ketmar@ketmar.no-ip.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ketmar@ketmar.no-ip.org -- |
December 21, 2016 [Issue 16997] Real-life evidence for integer promotion of unary minus creating bugs when porting C code | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 --- Comment #1 from ponce <aliloko@gmail.com> --- Created attachment 1626 --> https://issues.dlang.org/attachment.cgi?id=1626&action=edit Patch in ketmar DMD fork ("aliced") to make unary +/- on small integers a warning -- |
December 21, 2016 [Issue 16997] Real-life evidence for integer promotion of unary minus creating bugs when porting C code | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 Ketmar Dark <ketmar@ketmar.no-ip.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #1626|0 |1 is obsolete| | --- Comment #2 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- Created attachment 1627 --> https://issues.dlang.org/attachment.cgi?id=1627&action=edit warning on unary minus/plus fixed patch, made against vanilla. it will show warning for unary -/+ for (u)byte and (u)short, but one can silence that with `-(expr)`. it prolly needs better message with explanation of what it is, and what to do, and why -- but i leave that for that one who will make a PR out of the patch. -- |
December 21, 2016 [Issue 16997] Real-life evidence for integer promotion of unary minus creating bugs when porting C code | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 --- Comment #3 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- as for the question: promotion rules are what they are currently to allow this: byte n; n = -n; if unary minus will promote `n`, you will need to add `cast` there. and negate never ever drop bits from integer (even byte.min is essentially unchanged, so no info is lost), so it is -- relatively -- safe to not promote here. -- |
December 21, 2016 [Issue 16997] Real-life evidence for integer promotion of unary minus creating bugs when porting C code | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 --- Comment #4 from Ketmar Dark <ketmar@ketmar.no-ip.org> --- p.s.: i'm not that smart, tbh, i understood the rationale behind the design after alot of hard thinking. -- |
July 11, 2017 [Issue 16997] Real-life evidence for integer promotion of unary minus creating bugs when porting C code | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com See Also| |https://issues.dlang.org/sh | |ow_bug.cgi?id=17637 -- |
July 22, 2017 [Issue 16997] Integral promotion rules not being followed for negation expressions | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Real-life evidence for |Integral promotion rules |integer promotion of unary |not being followed for |minus creating bugs when |negation expressions |porting C code | -- |
July 22, 2017 [Issue 16997] Integral promotion rules not being followed for negation expressions | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 --- Comment #5 from Walter Bright <bugzilla@digitalmars.com> --- https://github.com/dlang/dmd/pull/7013 -- |
July 22, 2017 [Issue 16997] Integral promotion rules not being followed for negation expressions | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 --- Comment #6 from Walter Bright <bugzilla@digitalmars.com> --- *** Issue 17637 has been marked as a duplicate of this issue. *** -- |
July 22, 2017 [Issue 16997] Integral promotion rules not being followed for negation expressions | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16997 --- Comment #7 from Walter Bright <bugzilla@digitalmars.com> --- Unary + and unary ~ are also broken in the same way. -- |
Copyright © 1999-2021 by the D Language Foundation