Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!execu!sequoia!nueces!chari From: chari@nueces.cactus.org (Chris Whatley) Newsgroups: comp.sys.next Subject: Re: Whats wrong? Message-ID: <1989Nov29.072855.4018@nueces.cactus.org> Date: 29 Nov 89 07:28:55 GMT References: <1989Nov29.014513.21386@csusac.csus.edu> Organization: Nueces Inc. Lines: 29 hoodr@syscube.csus.edu (Robert Hood) writes: >I ran into a little problem. I have this piece of code that works on all >the Unix boxes I could try, *EXCEPT* the NeXT: >struct test demo = { "this are a test", 4}; >main () > { > puts (demo.temp); > *demo.temp = '*'; > puts (demo.temp); > } >this are a test >Bus error >Why? Am I missing a compiler option somewhere? (I just used 'cc test.c') Yes you are. You need the "fwritable-strings" option to gcc to allow you to alter a string constant like you have above. This is a very useful flag when you are porting since this is such a common practice. Chris -- Chris Whatley Work: chari@pelican.ma.utexas.edu (NeXT Mail) (512/471-7711 ext 123) Play: chari@nueces.cactus.org (NeXT Mail) (512/499-0475) Also: chari@emx.utexas.edu