From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3965 invoked by alias); 24 Nov 2006 11:40:36 -0000 Received: (qmail 3954 invoked by uid 22791); 24 Nov 2006 11:40:36 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.191) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Nov 2006 11:40:32 +0000 Received: by nf-out-0910.google.com with SMTP id p46so1207848nfa for ; Fri, 24 Nov 2006 03:40:29 -0800 (PST) Received: by 10.82.105.13 with SMTP id d13mr1570421buc.1164368429196; Fri, 24 Nov 2006 03:40:29 -0800 (PST) Received: by 10.82.159.10 with HTTP; Fri, 24 Nov 2006 03:40:29 -0800 (PST) Message-ID: <9ee2fe770611240340sb6907f9k9e21d0814d71475b@mail.gmail.com> Date: Fri, 24 Nov 2006 11:40:00 -0000 From: "kanishk rastogi" To: "Andrew Haley" Subject: Re: Problem with the string Cc: gcc-help@gcc.gnu.org In-Reply-To: <17766.55298.207344.163962@zebedee.pink> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9ee2fe770611240126t47803b82gc733ae0e7d61b746@mail.gmail.com> <17766.49617.952075.116206@zebedee.pink> <9ee2fe770611240214vc69d03eg7493ab05b913077a@mail.gmail.com> <17766.50893.613365.742603@zebedee.pink> <9ee2fe770611240221g1ba97a3axd591b89267b960b1@mail.gmail.com> <17766.51276.179245.1953@zebedee.pink> <9ee2fe770611240230i4cc7a449ra280da3dfacd3674@mail.gmail.com> <17766.52089.676318.750296@zebedee.pink> <9ee2fe770611240316p30920d39nb1d28dde53936ea0@mail.gmail.com> <17766.55298.207344.163962@zebedee.pink> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-11/txt/msg00283.txt.bz2 On 11/24/06, Andrew Haley wrote: > kanishk rastogi writes: > > On 11/24/06, Andrew Haley wrote: > > > kanishk rastogi writes: > > > > On 11/24/06, Andrew Haley wrote: > > > > > kanishk rastogi writes: > > > > > > if i call a func like: > > > > > > > > > > > > func("kanishk"); > > > > > > the string "kanishk" will be defined in readonly segment or in read - > > > > > > write segment ? > > > > > > if they will be in read-only segment i dont want that.... > > > > > > how can this be done > > > > > > > > > > Dammit, how many times do I have to repeat this? > > > > > > > > > > You just gotta declare them right. Like this: > > > > > > > > > > char s[] = "kanishk"; > > > > > func(s); > > > > > > > thanks for the advice andrew > > > > and sorry for the annoyance > > > > but the fact is I cant change the code because its more than 8000 > > > > lines so i am asking for a feature in gcc which i would have missed > > > > > > Your code is wrong. "How do I get gcc to compile this code with these > > > bugs?" is not a sensible question. Fix the bugs! > > > sorry > > the code is not buggy. i think u have misunderstood the real problem statement. > > > > so the problem in more detail is as below: > > > > printf("kanishk"); > > > > the above code compiles perfectly with gcc -Wall. > > gcc by default puts the string into read execute segment,but i want to > > put string "kanishk" into writeable memory (or other than read execute > > segment). Is there a way for doing this without making any change in > > calling sequence (for example it may be regulated by some switch in > > gcc) or there is no provision in C99 standard for it. > > OK, if it's not a bug, I need to ask another question. I don't > understand you at all: why do you want to put a constant string into > writable memory? Is this embedded, or what? its not. > > Andrew. > i