From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin v. Loewis" To: zoluic@telostech.com Cc: gcc-help@gcc.gnu.org Subject: Re: String literals Date: Wed, 05 Apr 2000 17:04:00 -0000 Message-id: <200004052356.BAA01094@loewis.home.cs.tu-berlin.de> References: <38EB99A1.DA0D547E@telostech.com> X-SW-Source: 2000-04/msg00017.html > 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