This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: String literals
- To: zoluic at telostech dot com
- Subject: Re: String literals
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 6 Apr 2000 01:56:44 +0200
- CC: gcc-help at gcc dot gnu dot org
- References: <38EB99A1.DA0D547E@telostech.com>
> 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