This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
typedef makes const array not readonly
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: typedef makes const array not readonly
- From: "Hodges, Philip" <Philip dot Hodges at compaq dot com>
- Date: Thu, 27 Jul 2000 15:52:35 +0200
/* typedef makes const array not readonly */
typedef struct thing_t { char x[10000]; } thing_t;
typedef const thing_t data_thing_array_t [];
data_thing_array_t data_array = { { 0 }, { 0 } }; /* 20k */
const thing_t const_array[] = { { 0 }, { 0 }, { 0 } }; /* 30k */
/*
$ cc -c consttypedef.c ; size consttypedef.o
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
got:
text data bss dec hex filename
30000 20000 0 50000 c350 consttypedef.o
expected:
text data bss dec hex filename
50000 0 0 50000 c350 consttypedef.o
*/