This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc-2.95.1 problems with -traditional and initialization
- To: Eric Norum <eric at cls dot usask dot ca>
- Subject: Re: Gcc-2.95.1 problems with -traditional and initialization
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 07 Sep 1999 00:52:29 -0600
- cc: gcc-bugs at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
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