[Bug c/66773] sign-compare warning for == and != are pretty useless

2019-11-21 Thread daniel.marjamaki at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773 --- Comment #9 from Daniel Marjamäki --- Problems; * Code that performs comparison properly gets a warning. * Code where programmer makes a mistake with a cast does not generate a warning. * This warning encourage programmers to cast and wh

[Bug c/66773] sign-compare warning for == and != are pretty useless

2019-11-21 Thread daniel.marjamaki at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773 --- Comment #10 from Daniel Marjamäki --- Well I am just a happy gcc user.. if some gcc maintainer thinks this ticket is invalid feel free to close it. I can't expect that everybody will think just like me. :-) As a Cppcheck developer I am dissa

[Bug c/66773] sign-compare warning for == and != are pretty useless

2019-11-21 Thread daniel.marjamaki at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773 --- Comment #12 from Daniel Marjamäki --- > Do you have examples of perfectly fine code where you get a warning? So, how would you fix the warning for `f`? Many programmers would "fix" it with a cast. Assuming that `s` and `u` can have arbitrar

[Bug c/66773] sign-compare warning for == and != are pretty useless

2019-11-22 Thread daniel.marjamaki at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773 --- Comment #19 from Daniel Marjamäki --- (In reply to Segher Boessenkool from comment #15) > (In reply to Daniel Marjamäki from comment #12) > > So, how would you fix the warning for `f`? Many programmers would "fix" it > > with a cast. > > > >

[Bug c/66773] sign-compare warning for == and != are pretty useless

2019-11-27 Thread daniel.marjamaki at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773 --- Comment #20 from Daniel Marjamäki --- (In reply to Segher Boessenkool from comment #15) > (In reply to Daniel Marjamäki from comment #12) > > So, how would you fix the warning for `f`? Many programmers would "fix" it > > with a cast. > > > >

[Bug c/66773] sign-compare warning for == and != are pretty useless

2019-11-29 Thread daniel.marjamaki at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773 --- Comment #23 from Daniel Marjamäki --- > If the user expects C to provide tests for "mathematically different", the user has some learning to do. I believe most users can appreciate this. But few users fully understand the integer conversions

[Bug rtl-optimization/53417] New: multiple assignments can be optimized

2012-05-19 Thread daniel.marjamaki at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53417 Bug #: 53417 Summary: multiple assignments can be optimized Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Prior

[Bug rtl-optimization/53417] optimize multiple movb into a single movl

2012-05-19 Thread daniel.marjamaki at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53417 Daniel Marjamäki changed: What|Removed |Added Summary|multiple assignments can be |optimize multiple movb into

[Bug rtl-optimization/53417] optimize multiple movb into a single movl

2012-05-19 Thread daniel.marjamaki at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53417 --- Comment #2 from Daniel Marjamäki 2012-05-19 19:44:13 UTC --- To clarify a little. The objdump output from my code example is: : 0:48 83 ec 18 sub$0x18,%rsp 4:48 89 e7 mov%rs

[Bug c/66773] New: sign-compare warning for == and != are pretty useless

2015-07-06 Thread daniel.marjamaki at gmail dot com
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: daniel.marjamaki at gmail dot com Target Milestone: --- I wrote a clang bug report: https://llvm.org/bugs/show_bug.cgi?id=24036 I recommend that -Wsign-compare is not written for == and != comparisons. For relational

[Bug c/37591] suppress "signed and unsigned" warnings when signed value known to be positive

2015-07-06 Thread daniel.marjamaki at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37591 Daniel Marjamäki changed: What|Removed |Added CC||daniel.marjamaki at gmail dot com

[Bug c/66773] sign-compare warning for == and != are pretty useless

2015-07-06 Thread daniel.marjamaki at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773 --- Comment #2 from Daniel Marjamäki --- Thanks! Hmm.. in my humble opinion, when I see the code: int f(void) { return 0x == -1; } .. I get the impression that the developer probably wants to test if the bitpattern 0xfff.. matches -1.

[Bug c/66773] sign-compare warning for == and != are pretty useless

2015-07-06 Thread daniel.marjamaki at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773 --- Comment #4 from Daniel Marjamäki --- absolutely. there are often bugs in the boundaries. well. I was hoping to get more optimistic response. how about this.. imagine that we wrote a "possible division by zero" warning for every integer divi

[Bug c/7652] -Wswitch-break : Warn if a switch case falls through

2011-07-29 Thread daniel.marjamaki at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 Daniel Marjamäki changed: What|Removed |Added CC||daniel.marjamaki at gmail

[Bug c/30475] assert(int+100 > int) optimized away

2021-01-05 Thread daniel.marjamaki at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475 Daniel Marjamäki changed: What|Removed |Added CC||daniel.marjamaki at gmail dot com

[Bug c/30475] assert(int+100 > int) optimized away

2021-01-05 Thread daniel.marjamaki at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475 --- Comment #63 from Daniel Marjamäki --- Sorry. I should have mentioned I am a Cppcheck developer in my comment.

[Bug c/30475] assert(int+100 > int) optimized away

2021-01-06 Thread daniel.marjamaki at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475 --- Comment #66 from Daniel Marjamäki --- Thanks! I can appreciate that it's not very simple. Well using a flag is totally acceptable. I don't trust the sanitizer completely but those that do can use the optimisation.