[Issue 6949] no warning or error if unsigned variable is compared to 0

2023-02-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6949 RazvanN changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 6949] no warning or error if unsigned variable is compared to 0

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6949 Iain Buclaw changed: What|Removed |Added Priority|P2 |P4 --

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-12-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #17 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-12-18 09:19:32 PST --- *** Issue 5539 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #12 from bearophile_h...@eml.cc 2012-11-30 04:17:15 PST --- Regarding a comment by Don, is it possible to generate a warning/error only in foo() and not in bar()? void foo(uint x) { if (x 0) {} // error or warning here } void

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #14 from bearophile_h...@eml.cc 2012-11-30 05:25:50 PST --- (In reply to comment #13) (In reply to comment #12) Regarding a comment by Don, is it possible to generate a warning/error only in foo() and not in bar()?

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #15 from Don clugd...@yahoo.com.au 2012-11-30 06:31:17 PST --- (In reply to comment #14) (In reply to comment #13) (In reply to comment #12) Regarding a comment by Don, is it possible to generate a warning/error only in

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #16 from bearophile_h...@eml.cc 2012-11-30 09:36:58 PST --- (In reply to comment #15) BTW std.bigint has a lot of examples of valid comparisons of unsigned 0 . The comparisons in std.bigint are like this, all of them are inside

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 Andrej Mitrovic andrej.mitrov...@gmail.com changed: What|Removed |Added Keywords||pull

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc ---

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #3 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-11-29 16:40:59 PST --- (In reply to comment #2) Is Phobos giving some warnings with this patch? More study is probably needed. The autotester is running. It failed once

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #5 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-11-29 17:21:48 PST --- (In reply to comment #4) In your code this comment is obsolete: // Warn when unsigned type is ... Thanks. -- Configure issuemail:

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #4 from bearophile_h...@eml.cc 2012-11-29 17:20:37 PST --- (In reply to comment #3) I've added a workaround so the warning isn't triggered in this case anymore. We'll see what the tester says.. OK. It seems Andrei has

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #6 from bearophile_h...@eml.cc 2012-11-29 18:03:20 PST --- How about code like this? void main() { uint i = 0; if (i == -2) assert(0, never); } Note that this is currently valid D code: void main() { uint i =

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #7 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-11-29 18:14:27 PST --- (In reply to comment #6) How about code like this? void main() { uint i = 0; if (i == -2) assert(0, never); } Note that

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #8 from bearophile_h...@eml.cc 2012-11-29 18:17:45 PST --- (In reply to comment #7) I want to see how Walter reacts to the pull before these are handled. Right, OK. This new error message of yours hits code like this in

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #9 from bearophile_h...@eml.cc 2012-11-29 18:22:17 PST --- Maybe you want to temporarily turn your new error message into a warning (that later will become an error again, if you want), so if Phobos gets entirely compiled with -wi

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #10 from Walter Bright bugzi...@digitalmars.com 2012-11-29 19:50:14 PST --- (In reply to comment #6) How about code like this? void main() { uint i = 0; if (i == -2) assert(0, never); } Equality has nothing

[Issue 6949] no warning or error if unsigned variable is compared to 0

2012-11-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 --- Comment #11 from bearophile_h...@eml.cc 2012-11-29 20:15:15 PST --- (In reply to comment #10) Some languages, such as Java, deal with this duality by defining the unsigned type out of existence. There are languages like Ada, that have

[Issue 6949] no warning or error if unsigned variable is compared to 0

2011-11-16 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6949 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC|