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.
- Tel ( http://bespoke.homelinux.net/ )
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html