home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / vms / 18311 < prev    next >
Encoding:
Internet Message Format  |  1992-11-21  |  2.2 KB

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