home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / hp / 9849 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.9 KB

  1. Path: sparky!uunet!mcsun!corton!enst!ulysse!philipp
  2. From: philipp@ulysse.enst.fr (Philippe-Andre Prindeville)
  3. Newsgroups: comp.sys.hp
  4. Subject: Curious NIDL behaviour
  5. Keywords: NIDL, NCS, compiler bug?
  6. Message-ID: <2498@ulysse.enst.fr>
  7. Date: 29 Aug 92 13:17:46 GMT
  8. Reply-To: philipp@res.enst.fr (Philippe-Andre Prindeville)
  9. Organization: Telecom Paris, France
  10. Lines: 54
  11.  
  12. Apologies if this isn't the right news group...  there are no NCS/NIDL
  13. or OSF news groups of which I am aware.
  14.  
  15. I'm writing a dictionary server in NIDL for NCS, and I'm pulling my
  16. hair out over seeming compiler anomolies...
  17.  
  18. I've declared a data type:
  19.  
  20.     typedef    unsigned long        index_t;
  21.  
  22.     typedef struct {
  23.         String[20]        word;
  24.         int            last;
  25.         index_t [last_is(last)]    index[];
  26.     } biblio_t;
  27.  
  28. the idea being that the data type describes a word and all the
  29. associated references as inverted keys...
  30.  
  31. Then, I declare a function:
  32.  
  33.     [idempotent] biblio_t getref(const char *);
  34.  
  35. that searches for this word in the data base, then returns a
  36. descriptor off all matching references (there are 160,000+ in all).
  37.  
  38. So, the problems I am experiencing are:
  39.  
  40.     (a) since I am returning an open-ended array as the return
  41.         value (and not an [out] parameter!) it isn't clear
  42.         who does the release of this malloc'd memory
  43.     (b) the preprocessor (nidl) seems to be generating bogus
  44.         stub code where the function handle invocation
  45.         is not properly declared and/or cooerced. (this is
  46.         the more serious bug):
  47.  
  48. /* server call */
  49. getsgl_= (*manager_epv->getsgl)(index_);
  50. bound=0;
  51.  
  52. causes "error 1527: Incompatible types in cast.".  I am using 8.07
  53. with the ANSI mode on the compiler.
  54.  
  55. I must say that I think the semantics of [last_is(x)] are entirely
  56. broken for C, which has 0-based arrays and not 1-based arrays like
  57. Pascal.  If it had been [size_is(x)] instead, this would work
  58. independent of the array index-basing.
  59.  
  60. I guess this bug is a bit particular, so please respond to me
  61. privately...
  62.  
  63. Thanks,
  64.  
  65. -Philip                        <philipp@res.enst.fr>
  66.