Scoping question in C

G. Matthew Rice matt-s/rLXaiAEBtBDgjK7y7TUQ at public.gmane.org
Fri Jun 10 13:54:57 UTC 2005


John Vetterli <jvetterli-zC6tqtfhjqE at public.gmane.org> writes:
> (*) I think there's a way to get gcc to put the string (or all strings) into
> the data segment, allowing you to overwrite it.  I have never looked into how
> to do this, though.

Nor should you ;)  I think that you're looking for this:

       -fwritable-strings
           Store string constants in the writable data segment and don't
           uniquize them.  This is for compatibility with old programs which
           assume they can write into string constants.

           Writing into string constants is a very bad idea; ''constants''
           should be constant.

Regards,
-- 
g. matthew rice <matt-s/rLXaiAEBtBDgjK7y7TUQ at public.gmane.org>           starnix, toronto, ontario, ca
phone: 647.722.5301 x242                                  gpg id: EF9AAD20
http://www.starnix.com              professional linux services & products
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list