home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!network.ucsd.edu!munnari.oz.au!bruce.cs.monash.edu.au!monu6!yoyo.cc.monash.edu.au!parry
- From: parry@yoyo.cc.monash.edu.au (Tom J Parry)
- Subject: Re: why is it with kernel 0.99 that -fwritable-strings is required
- Message-ID: <1992Dec29.085026.14621@monu6.cc.monash.edu.au>
- Originator: parry@yoyo.cc.monash.edu.au
- Sender: news@monu6.cc.monash.edu.au (Usenet system)
- Organization: Monash University, Melb., Australia.
- References: <Bzzv0w.F9@rshark.mixcom.com>
- Date: Tue, 29 Dec 1992 08:50:26 GMT
- Lines: 17
-
- Brian Kapitan (root@rshark.mixcom.com) wrote:
- >why is it now, that the gcc option -fwritable-strings is required to
- >correctly make certain programs, when in the past it wasn't true?
-
- The ANSI standard says that "C" strings are of type "const char[]". Thus
- your shouldn't be able to write to them. The gcc compiler puts strings
- in a read only part of the text... thus there is only ever one copy of
- them in memory at any time.
-
- >what was changed in the kernel to cause this?
-
- The kernel now enforces non-writable program texts. Thus you get a seg
- fault when you try to write into your text.
-
- --
- Tom J Parry.
- Your reality is a figment of my imagination.
-