This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

typedef makes const array not readonly


/* 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

*/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]