This is the mail archive of the gcc-help@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: String literals


> I am having a problem running the enclosed test program. I expected
> program to pass the test points 1, 2 and 3 but instead it cored at
> point 2 (3). After looking into generated assembler code I noticed
> that string literals casted to array initializers (see pointers S2
> and s3) were put into read only segment. Is this correct (i.e. in
> compilance with ANSI C standard ) ?

Yes, this is indeed in compliance with the ISO C standard. gcc has an
option -fwritable-strings if you really need that function.

Regards,
Martin


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