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]

gcc-2.95 19990623 (prerelease) problem with string initializer and -fwritable-strings


Hi,

The current gcc 2.95 snapshots have problems with string initializers,
when compiling with the -fwritable-strings option:

% cat x.c
struct {
        char bla[2];
} data = {
        "xx",
};

% gcc -fwritable-strings -S x.c
x.c:4: initializer element is not constant
x.c:4: (near initialization for `data.bla')

% gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/gcc-2.95/specs
gcc version gcc-2.95 19990623 (prerelease)


Without the -fwritable-strings option, the file compiles ok.

-- 
Juergen Keil          		jk@tools.de
Tools GmbH			+49 (228) 9858011


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