This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/58235] New: Missing diagnostic on assignment to array in c89
- From: "olivier.gay at a3 dot epfl.ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Aug 2013 22:32:01 +0000
- Subject: [Bug c/58235] New: Missing diagnostic on assignment to array in c89
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58235
Bug ID: 58235
Summary: Missing diagnostic on assignment to array in c89
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: olivier.gay at a3 dot epfl.ch
struct bla
{
int x[1];
} s = {{0}};
struct bla foo(void)
{
return s;
}
void bar(void)
{
int c[1];
c = foo().x;
}
gcc in c89 mode (-std=c89 -Wall -pedantic) does not issue a diagnostic for the
assignment to a non-modifiable lvalue in bar function. -std=c99 or -std=c11 do
issue the required diagnostic.