https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18063
--- Comment #8 from joseph at codesourcery dot com ---
I think we should diagnose the definition of the struct (generally, any
construction of a too-large fixed-size type in any context).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18063
Martin Sebor changed:
What|Removed |Added
Last reconfirmed|2005-09-18 01:37:52 |2016-5-17
CC|
--- Comment #6 from manu at gcc dot gnu dot org 2006-12-01 00:31 ---
(In reply to comment #5)
> (In reply to comment #2)
> > Subject: Re: Gcc doesn't check overflowed size of structure
> >
> > If you rewrite it to
>
> That is because there is no constant overflow. Just an overflow at
--- Comment #5 from pinskia at gcc dot gnu dot org 2005-12-18 01:36 ---
(In reply to comment #2)
> Subject: Re: Gcc doesn't check overflowed size of structure
>
> If you rewrite it to
That is because there is no constant overflow. Just an overflow at the
runtime.
--
http://gcc.g
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-20 14:13
---
Confirmed.
--
What|Removed |Added
Status|UNCONFIRMED |NEW
E
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-19 18:30
---
Note if you make a global variable of the struct we do error out.
--
What|Removed |Added
--- Additional Comments From mikulas at artax dot karlin dot mff dot cuni dot cz
2004-10-19 17:32 ---
Subject: Re: Gcc doesn't check overflowed size of structure
If you rewrite it to
int main(void)
{
size_t c = sizeof(struct a);
struct a *b = malloc(c);
return
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-19 17:25
---
On the mainline we warn:
t68.c:9: warning: integer overflow in expression
So maybe this can be considered fixed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18063