https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
Martin Sebor changed:
What|Removed |Added
Status|WAITING |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #14 from Paul Eggert ---
Thanks, please feel free to mark this as a duplicate of Bug#4210. I plan to
follow up there.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
Martin Sebor changed:
What|Removed |Added
Status|NEW |WAITING
--- Comment #13 from Martin Sebor
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #12 from Paul Eggert ---
If the proposed change would introduce significant problems with false
positives or false negatives, then surely GCC already has these problems in
conditional expressions. These problems ought to be addressed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #11 from Martin Sebor ---
Yes, bug 4210 looks like a duplicate. The test case from attachment 40722
recast in the context of that enhancement request looks like this:
int too_large (long x)
{
const int b = sizeof (int) < si
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #10 from joseph at codesourcery dot com ---
This is arguably the same as or similar to bug 4210 and its duplicates.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #9 from Paul Eggert ---
> 1) It's too subtle for non-expert programmers to understand.
Actually, it's typically easy for non-experts to follow this. For example,
although GCC falsely warns about this:
/*1*/ if (0) return INT_MAX +
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #8 from Martin Sebor ---
I understand the distinction, but I don't think it would be helpful to try to
make it in the implementation of the warning, for a few reasons:
1) It's too subtle for non-expert programmers to understand.
2) I
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #7 from Paul Eggert ---
> the translation of a program that contains an overflowing constant expression
> has undefined behavior
Sure, but the programs in question do not contain constant expressions in sense
of the C standard. They
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
Martin Sebor changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
Martin Sebor changed:
What|Removed |Added
CC||msebor at gcc dot gnu.org
--- Comment #5
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #4 from Marek Polacek ---
I might, but the front ends, where the warning is taking place, can't see that
the function always returns early.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #3 from Bruno Haible ---
(In reply to Marek Polacek from comment #2)
> int
> fn1 (long x)
> {
> if (0)
> return __INT_MAX__ + 1;
>
> if (x || 0)
> return __INT_MAX__ + 1; /* { dg-warning "integer overflow" } */
>
> if
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
--- Comment #2 from Marek Polacek ---
Generalized extended testcase:
int
fn1 (long x)
{
if (0)
return __INT_MAX__ + 1;
if (x || 0)
return __INT_MAX__ + 1; /* { dg-warning "integer overflow" } */
if (1 || 0)
return __INT_MAX__
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479
Marek Polacek changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
15 matches
Mail list logo