[Bug c++/48850] Bogus overflow in constant expression warning
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jun 16 12:42:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48850
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|rejects-valid |
Status|RESOLVED |REOPENED
Component|c |c++
Resolution|FIXED |---
Known to fail| |5.0
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Still present with the C++ frontend though.
> g++-5 -S t.c
t.c:3:36: warning: integer overflow in expression [-Woverflow]
extern char a[((size_t)-1 >> 1) + 1]; /* { dg-error "too large" } */
^
t.c:3:36: error: overflow in array dimension
t.c:3:36: error: size of array ‘a’ is too large
t.c:5:51: error: size of array ‘c’ is too large
extern int c[(((size_t)-1 >> 1) + 1) / sizeof(int)]; /* { dg-error "too large"
More information about the Gcc-bugs
mailing list