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]

Re: Gcc-2.95.1 problems with -traditional and initialization


  In message <37D03C79.7152520F@cls.usask.ca>you write:
  > There seems to be a problem with initializing character arrays in
  > structures when string literals are writable.
  > 
  > Host: Redhat Linux 2.2.5-15
  > 
  > Compiler: gcc-2.95.1 as native compiler and as m68k cross-compiler.
  > 
  > Example program:
  > ===================================================
  > typedef struct fleeb {
  >     char msg[20];
  > } fleeb;
  > 
  > fleeb foo = {"bar"};
  > ===================================================
  > 
  > Example run:
  > + gcc --version
  > 2.95.1
  > 
  > + gcc -traditional -c a.c
  > a.c:5: initializer element is not constant
  > a.c:5: (near initialization for `foo.msg')
Thanks.  I believe this has been fixed in the development sources.  The
patch that fixed this bug is on the list of patches to consider for gcc-2.95.2.
jeff


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