[EMAIL PROTECTED] wrote:
On Sun, Apr 18, 2004 at 08:58:56PM +1000, David Bowskill wrote:

HI SLUGgers,
I have this little problem with GCC which I wonder if anyone can enlighten me on. The little program below has been run on three different machines all with the same result. The program compiles OK under GCC but fails with a segmentation error. Under Borland 'C for DOS', it compiles and runs correctly.


From the "info gcc" pages:

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

     This option is deprecated.


Compiling with the above option will probably make your program work.

Until GCC 4.0

GCC 4.0 Release Series -- Changes, New Features, and Fixes
Caveats
...
 - GCC no longer accepts the -fwritable-strings option.
   Use named character arrays when you need a writable
   string.
...

--
 Glen Turner         Tel: (08) 8303 3936 or +61 8 8303 3936
 Australia's Academic & Research Network  www.aarnet.edu.au
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to