Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!dd26+ From: dd26+@andrew.cmu.edu (Douglas F. DeJulio) Newsgroups: comp.sys.next Subject: Re: Whats wrong? Message-ID: Date: 29 Nov 89 08:46:14 GMT References: <1989Nov29.014513.21386@csusac.csus.edu> Organization: Chemistry, Carnegie Mellon, Pittsburgh, PA Lines: 16 In-Reply-To: <1989Nov29.014513.21386@csusac.csus.edu> 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: [...] > Its a very simple piece of code that replaces the first character with an > '*'. It produces: > > this are a test > Bus error This is occuring becuase gcc by default does not let you write into strings that started as constants. If you give the compiler the "-fwritable-strings" switch it should work as you expect. -- Doug.deJ | dd26@andrew.cmu.edu | Carnegie-Mellon University ******** | ...!harvard!andrew.cmu.edu!dd26 | Do not attend this college.