home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.vms:18311 comp.lang.c:16980
- Path: sparky!uunet!stanford.edu!rock!concert!ais.com!bruce
- From: bruce@ais.com (Bruce C. Wright)
- Newsgroups: comp.os.vms,comp.lang.c
- Subject: Re: String Pointer Passing Problem with VAX C
- Message-ID: <1992Nov21.213842.5853@ais.com>
- Date: 21 Nov 92 21:38:41 GMT
- References: <By1Dvp.Gpu@ux1.cso.uiuc.edu> <1ek1dtINNeqa@gap.caltech.edu>
- Distribution: world
- Organization: Applied Information Systems, Chapel Hill, NC
- Lines: 39
-
- In article <1ek1dtINNeqa@gap.caltech.edu>, carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) writes:
- > In article <By1Dvp.Gpu@ux1.cso.uiuc.edu>, jsivier@ux1.cso.uiuc.edu (Jonathon Sivier ) writes:
- > = I have run into a very wierd bug/problem. I have a series of routines
- > =that I am passing string (char) pointers between. [...]
- >
- > OK. That does it. I'm going to write up a set of guidelines for posting to
- > comp.os.vms (a.k.a. info-vax).
- >
- > One of the principal guidelines will be:
- > IF YOU'VE GOT A PROBLEM USING SOFTWARE YOU'VE WRITTEN YOURSELF, INCLUDE
- > A MINIMAL CODE FRAGMENT THAT REPRODUCES THE PROBLEM.
-
- I agree with Carl. It's not obvious what's going wrong with the
- program from that description. I've done quite a few things like
- this with VAX C, and I'm quite confident that there's no obvious
- bug of this nature in the compiler (if there's a bug in the compiler
- then it's non-obvious and there's no way to track it down without a
- sample of the code that fails).
-
- My suspicion is that the original author did something wrong,
- possibly doing the pointer setup incorrectly when passing the
- string pointer into the routine, but it's impossible to know
- for sure (one easy way for this to happen on any C compiler is
- to have a multi-dimensioned array and to have an `off-by-one'
- error in specifying the first index in the array -- forgetting
- that C arrays start at 0, for instance).
-
- It would really help to know:
-
- * The version of VMS that this fails on;
- * The version of VAX C that this fails on;
- * Whether the code has been tried on any other systems,
- and whether it works on them if so;
- * And a listing of the code in question.
-
- Without at least the last item in this list, it's impossible
- to do more than guess what the problem might be.
-
- Bruce C. Wright
-