home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gossip.pyramid.com!olivea!bu.edu!news.bbn.com!mips2!bubba!sje
- From: sje@xylos.ma30.bull.com (Steven J. Edwards)
- Newsgroups: comp.os.coherent
- Subject: Re: Bug in Coherent 4.0 Compiler
- Message-ID: <SJE.92Aug17114818@xylos.ma30.bull.com>
- Date: 17 Aug 92 15:48:18 GMT
- References: <1992Aug17.133350.7012@miles.com>
- Sender: news@mips2.ma30.bull.com (Usenet News Manager)
- Reply-To: sje@xylos.ma30.bull.com
- Distribution: usa
- Organization: Bull HN, Worldwide Information Systems, Billerica, Mass., USA
- Lines: 27
- In-Reply-To: geis@miles.com's message of 17 Aug 92 13:33:50 GMT
-
- > -------------------------------------- cut here ------------------------
- > char *string = "Hello World\n";
- >
- > main()
- > {
- > char **pp;
- >
- > *pp = string;
- > printf("%s", *pp);
- > }
- > -------------------------------------- and here ------------------------
- >
- > This program bombs my system and dumps the core. I have tried this
- > on other UNIX systems and even dos and it works just fine...
- >
- > How can this get corrected? Do we have to wait until 4.1????
-
- It's a bug in your code. The value of variable pp is undefined at the
- time it is dereferenced in the statement "*pp = string". That
- assignment is either trashing four bytes somewhere or trying to write
- outside the data segment. It is not a problem with Coherent.
-
- [The above opinions expressed are my own; not necessarily held by others.]
- == Steven J. Edwards Bull HN Information Systems Inc. ==
- == (508) 294-3484 300 Concord Road MS 820A ==
- == sje@xylos.ma30.bull.com Billerica, MA 01821 USA ==
- "That Government which Governs the Least, Governs Best." -- Thomas Jefferson
-