public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with the string
@ 2006-11-24  9:26 kanishk rastogi
  2006-11-24  9:56 ` Andrew Haley
  2006-11-28  2:57 ` Michael Eager
  0 siblings, 2 replies; 15+ messages in thread
From: kanishk rastogi @ 2006-11-24  9:26 UTC (permalink / raw)
  To: gcc-help

hi all,
when we compile our c programs the strings which we use get defined in
read only memory.
how can i ask the gcc compiler to declare them in read-write section.
or in other words
how can i as the compiler to perform the same operation as performed
by it when we use --fno-const-strings while compiling c++ prog

thanks in advance

-- 
Everybody is made for some purpose. Find yours.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24  9:26 Problem with the string kanishk rastogi
@ 2006-11-24  9:56 ` Andrew Haley
  2006-11-24 10:15   ` kanishk rastogi
  2006-11-28  2:57 ` Michael Eager
  1 sibling, 1 reply; 15+ messages in thread
From: Andrew Haley @ 2006-11-24  9:56 UTC (permalink / raw)
  To: kanishk rastogi; +Cc: gcc-help

kanishk rastogi writes:
 > hi all,
 > when we compile our c programs the strings which we use get defined in
 > read only memory.
 > how can i ask the gcc compiler to declare them in read-write section.

You just gotta declare them right.  Like this:

char s[] = "This is a string!";

Andrew.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24  9:56 ` Andrew Haley
@ 2006-11-24 10:15   ` kanishk rastogi
  2006-11-24 10:18     ` Andrew Haley
  0 siblings, 1 reply; 15+ messages in thread
From: kanishk rastogi @ 2006-11-24 10:15 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc-help

On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
> kanishk rastogi writes:
>  > hi all,
>  > when we compile our c programs the strings which we use get defined in
>  > read only memory.
>  > how can i ask the gcc compiler to declare them in read-write section.
>
> You just gotta declare them right.  Like this:
>
> char s[] = "This is a string!";
what abt the strings passed to functions?
i dont want to have them in readonly menory

thanks

>
> Andrew.
>
>

-- 
Everybody is made for some purpose. Find yours.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 10:15   ` kanishk rastogi
@ 2006-11-24 10:18     ` Andrew Haley
  2006-11-24 10:21       ` kanishk rastogi
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Haley @ 2006-11-24 10:18 UTC (permalink / raw)
  To: kanishk rastogi; +Cc: gcc-help

kanishk rastogi writes:
 > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
 > > kanishk rastogi writes:
 > >  > hi all,
 > >  > when we compile our c programs the strings which we use get defined in
 > >  > read only memory.
 > >  > how can i ask the gcc compiler to declare them in read-write section.
 > >
 > > You just gotta declare them right.  Like this:
 > >
 > > char s[] = "This is a string!";
 > what abt the strings passed to functions?
 > i dont want to have them in readonly menory

They won't be in read-only memory: as I said, you just gotta declare
them right.

Andrew.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 10:18     ` Andrew Haley
@ 2006-11-24 10:21       ` kanishk rastogi
  2006-11-24 10:24         ` Andrew Haley
  0 siblings, 1 reply; 15+ messages in thread
From: kanishk rastogi @ 2006-11-24 10:21 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc-help

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


On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
> kanishk rastogi writes:
>  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
>  > > kanishk rastogi writes:
>  > >  > hi all,
>  > >  > when we compile our c programs the strings which we use get defined in
>  > >  > read only memory.
>  > >  > how can i ask the gcc compiler to declare them in read-write section.
>  > >
>  > > You just gotta declare them right.  Like this:
>  > >
>  > > char s[] = "This is a string!";
>  > what abt the strings passed to functions?
>  > i dont want to have them in readonly menory
>
> They won't be in read-only memory: as I said, you just gotta declare
> them right.
>
> Andrew.
>


-- 
Everybody is made for some purpose. Find yours.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 10:21       ` kanishk rastogi
@ 2006-11-24 10:24         ` Andrew Haley
  2006-11-24 10:31           ` kanishk rastogi
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Haley @ 2006-11-24 10:24 UTC (permalink / raw)
  To: kanishk rastogi; +Cc: gcc-help

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);


Andrew.

 > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
 > > kanishk rastogi writes:
 > >  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
 > >  > > kanishk rastogi writes:
 > >  > >  > hi all,
 > >  > >  > when we compile our c programs the strings which we use get defined in
 > >  > >  > read only memory.
 > >  > >  > how can i ask the gcc compiler to declare them in read-write section.
 > >  > >
 > >  > > You just gotta declare them right.  Like this:
 > >  > >
 > >  > > char s[] = "This is a string!";
 > >  > what abt the strings passed to functions?
 > >  > i dont want to have them in readonly menory
 > >
 > > They won't be in read-only memory: as I said, you just gotta declare
 > > them right.
 > >
 > > Andrew.
 > >
 > 
 > 
 > -- 
 > Everybody is made for some purpose. Find yours.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 10:24         ` Andrew Haley
@ 2006-11-24 10:31           ` kanishk rastogi
  2006-11-24 10:37             ` Andrew Haley
  0 siblings, 1 reply; 15+ messages in thread
From: kanishk rastogi @ 2006-11-24 10:31 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc-help

On 11/24/06, Andrew Haley <aph@redhat.com> 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);
>
>
> Andrew.
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

thanks in advance
>
>  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
>  > > kanishk rastogi writes:
>  > >  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
>  > >  > > kanishk rastogi writes:
>  > >  > >  > hi all,
>  > >  > >  > when we compile our c programs the strings which we use get defined in
>  > >  > >  > read only memory.
>  > >  > >  > how can i ask the gcc compiler to declare them in read-write section.
>  > >  > >
>  > >  > > You just gotta declare them right.  Like this:
>  > >  > >
>  > >  > > char s[] = "This is a string!";
>  > >  > what abt the strings passed to functions?
>  > >  > i dont want to have them in readonly menory
>  > >
>  > > They won't be in read-only memory: as I said, you just gotta declare
>  > > them right.
>  > >
>  > > Andrew.
>  > >
>  >
>  >
>  > --
>  > Everybody is made for some purpose. Find yours.
>


-- 
Everybody is made for some purpose. Find yours.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 10:31           ` kanishk rastogi
@ 2006-11-24 10:37             ` Andrew Haley
  2006-11-24 11:16               ` kanishk rastogi
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Haley @ 2006-11-24 10:37 UTC (permalink / raw)
  To: kanishk rastogi; +Cc: gcc-help

kanishk rastogi writes:
 > On 11/24/06, Andrew Haley <aph@redhat.com> 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!

8000 lines is a small piece of code, and you should be able to fix it
in less than an hour or so.

Andrew.

 > 
 > thanks in advance
 > >
 > >  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
 > >  > > kanishk rastogi writes:
 > >  > >  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
 > >  > >  > > kanishk rastogi writes:
 > >  > >  > >  > hi all,
 > >  > >  > >  > when we compile our c programs the strings which we use get defined in
 > >  > >  > >  > read only memory.
 > >  > >  > >  > how can i ask the gcc compiler to declare them in read-write section.
 > >  > >  > >
 > >  > >  > > You just gotta declare them right.  Like this:
 > >  > >  > >
 > >  > >  > > char s[] = "This is a string!";
 > >  > >  > what abt the strings passed to functions?
 > >  > >  > i dont want to have them in readonly menory
 > >  > >
 > >  > > They won't be in read-only memory: as I said, you just gotta declare
 > >  > > them right.
 > >  > >
 > >  > > Andrew.
 > >  > >
 > >  >
 > >  >
 > >  > --
 > >  > Everybody is made for some purpose. Find yours.
 > >
 > 
 > 
 > -- 
 > Everybody is made for some purpose. Find yours.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 10:37             ` Andrew Haley
@ 2006-11-24 11:16               ` kanishk rastogi
  2006-11-24 11:31                 ` Andrew Haley
  2006-11-24 18:45                 ` John (Eljay) Love-Jensen
  0 siblings, 2 replies; 15+ messages in thread
From: kanishk rastogi @ 2006-11-24 11:16 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc-help

On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
> kanishk rastogi writes:
>  > On 11/24/06, Andrew Haley <aph@redhat.com> 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.

>
> 8000 lines is a small piece of code, and you should be able to fix it
> in less than an hour or so.
>
> Andrew.
>
>  >
>  > thanks in advance
>  > >
>  > >  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
>  > >  > > kanishk rastogi writes:
>  > >  > >  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
>  > >  > >  > > kanishk rastogi writes:
>  > >  > >  > >  > hi all,
>  > >  > >  > >  > when we compile our c programs the strings which we use get defined in
>  > >  > >  > >  > read only memory.
>  > >  > >  > >  > how can i ask the gcc compiler to declare them in read-write section.
>  > >  > >  > >
>  > >  > >  > > You just gotta declare them right.  Like this:
>  > >  > >  > >
>  > >  > >  > > char s[] = "This is a string!";
>  > >  > >  > what abt the strings passed to functions?
>  > >  > >  > i dont want to have them in readonly menory
>  > >  > >
>  > >  > > They won't be in read-only memory: as I said, you just gotta declare
>  > >  > > them right.
>  > >  > >
>  > >  > > Andrew.
>  > >  > >
>  > >  >
>  > >  >
>  > >  > --
>  > >  > Everybody is made for some purpose. Find yours.
>  > >
>  >
>  >
>  > --
>  > Everybody is made for some purpose. Find yours.
>


-- 
Everybody is made for some purpose. Find yours.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 11:16               ` kanishk rastogi
@ 2006-11-24 11:31                 ` Andrew Haley
  2006-11-24 11:40                   ` kanishk rastogi
  2006-11-24 18:45                 ` John (Eljay) Love-Jensen
  1 sibling, 1 reply; 15+ messages in thread
From: Andrew Haley @ 2006-11-24 11:31 UTC (permalink / raw)
  To: kanishk rastogi; +Cc: gcc-help

kanishk rastogi writes:
 > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
 > > kanishk rastogi writes:
 > >  > On 11/24/06, Andrew Haley <aph@redhat.com> 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?

Andrew.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 11:31                 ` Andrew Haley
@ 2006-11-24 11:40                   ` kanishk rastogi
  2006-11-24 13:33                     ` Andrew Haley
  0 siblings, 1 reply; 15+ messages in thread
From: kanishk rastogi @ 2006-11-24 11:40 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc-help

On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
> kanishk rastogi writes:
>  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
>  > > kanishk rastogi writes:
>  > >  > On 11/24/06, Andrew Haley <aph@redhat.com> 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 11:40                   ` kanishk rastogi
@ 2006-11-24 13:33                     ` Andrew Haley
  2006-11-24 15:31                       ` Segher Boessenkool
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Haley @ 2006-11-24 13:33 UTC (permalink / raw)
  To: kanishk rastogi; +Cc: gcc-help

kanishk rastogi writes:
 > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
 > > kanishk rastogi writes:
 > >  > On 11/24/06, Andrew Haley <aph@redhat.com> wrote:
 > >  > > kanishk rastogi writes:
 > >  > >  > On 11/24/06, Andrew Haley <aph@redhat.com> 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.

Well, I'm about to give up, but I'll ask one last question.  You see,
the question you're asking doesn't make any sense.  No correct C or
C++ can possibly be affected by whether literal strings are in
writable memory or not, so your request is utterly baffling.  Why do
you care whether they're in writable memory?

Andrew.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24 13:33                     ` Andrew Haley
@ 2006-11-24 15:31                       ` Segher Boessenkool
  0 siblings, 0 replies; 15+ messages in thread
From: Segher Boessenkool @ 2006-11-24 15:31 UTC (permalink / raw)
  To: Andrew Haley; +Cc: kanishk rastogi, MSX to GCC

> Well, I'm about to give up, but I'll ask one last question.  You see,
> the question you're asking doesn't make any sense.  No correct C or
> C++ can possibly be affected by whether literal strings are in
> writable memory or not, so your request is utterly baffling.

Some really ancient (pre-ISO C) code requires it.  Older GCC versions
had a -fwritable-strings option for this.

Your suggestion to fix the code is of course the right way to go :-)


Segher

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: Problem with the string
  2006-11-24 11:16               ` kanishk rastogi
  2006-11-24 11:31                 ` Andrew Haley
@ 2006-11-24 18:45                 ` John (Eljay) Love-Jensen
  1 sibling, 0 replies; 15+ messages in thread
From: John (Eljay) Love-Jensen @ 2006-11-24 18:45 UTC (permalink / raw)
  To: kanishk rastogi, Andrew Haley; +Cc: gcc-help

Hi kanishk,

> 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.

The 'string "kanishk"' is a read-only non-modifiable C-string literal constant.

Are you programming in C or C++?  Then a read-only non-modifiable C-string literal constant is read-only and non-modifiable.  There is no provision in C or C++ to make a read-only non-modifiable C-string literal constant into a non-read-only modifiable C-string literal mutable.

If you want a modifiable string, you have to declare it that way, for example:

char kanishk[] = "kanishk";
MyFuncThatModifiesTheCharPtrData(kanishk);

(Hopefully the MyFuncThatModifiesTheCharPtrData doesn't overrun the buffer.)

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem with the string
  2006-11-24  9:26 Problem with the string kanishk rastogi
  2006-11-24  9:56 ` Andrew Haley
@ 2006-11-28  2:57 ` Michael Eager
  1 sibling, 0 replies; 15+ messages in thread
From: Michael Eager @ 2006-11-28  2:57 UTC (permalink / raw)
  To: kanishk rastogi; +Cc: gcc-help

kanishk rastogi wrote:
> hi all,
> when we compile our c programs the strings which we use get defined in
> read only memory.
> how can i ask the gcc compiler to declare them in read-write section.
> or in other words
> how can i as the compiler to perform the same operation as performed
> by it when we use --fno-const-strings while compiling c++ prog

One alternative which may or may not meet your needs:
you can modify the linker script to put all data in R/W memory.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-11-28  2:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-24  9:26 Problem with the string kanishk rastogi
2006-11-24  9:56 ` Andrew Haley
2006-11-24 10:15   ` kanishk rastogi
2006-11-24 10:18     ` Andrew Haley
2006-11-24 10:21       ` kanishk rastogi
2006-11-24 10:24         ` Andrew Haley
2006-11-24 10:31           ` kanishk rastogi
2006-11-24 10:37             ` Andrew Haley
2006-11-24 11:16               ` kanishk rastogi
2006-11-24 11:31                 ` Andrew Haley
2006-11-24 11:40                   ` kanishk rastogi
2006-11-24 13:33                     ` Andrew Haley
2006-11-24 15:31                       ` Segher Boessenkool
2006-11-24 18:45                 ` John (Eljay) Love-Jensen
2006-11-28  2:57 ` Michael Eager

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).