home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!corton!enst!ulysse!philipp
- From: philipp@ulysse.enst.fr (Philippe-Andre Prindeville)
- Newsgroups: comp.sys.hp
- Subject: Curious NIDL behaviour
- Keywords: NIDL, NCS, compiler bug?
- Message-ID: <2498@ulysse.enst.fr>
- Date: 29 Aug 92 13:17:46 GMT
- Reply-To: philipp@res.enst.fr (Philippe-Andre Prindeville)
- Organization: Telecom Paris, France
- Lines: 54
-
- Apologies if this isn't the right news group... there are no NCS/NIDL
- or OSF news groups of which I am aware.
-
- I'm writing a dictionary server in NIDL for NCS, and I'm pulling my
- hair out over seeming compiler anomolies...
-
- I've declared a data type:
-
- typedef unsigned long index_t;
-
- typedef struct {
- String[20] word;
- int last;
- index_t [last_is(last)] index[];
- } biblio_t;
-
- the idea being that the data type describes a word and all the
- associated references as inverted keys...
-
- Then, I declare a function:
-
- [idempotent] biblio_t getref(const char *);
-
- that searches for this word in the data base, then returns a
- descriptor off all matching references (there are 160,000+ in all).
-
- So, the problems I am experiencing are:
-
- (a) since I am returning an open-ended array as the return
- value (and not an [out] parameter!) it isn't clear
- who does the release of this malloc'd memory
- (b) the preprocessor (nidl) seems to be generating bogus
- stub code where the function handle invocation
- is not properly declared and/or cooerced. (this is
- the more serious bug):
-
- /* server call */
- getsgl_= (*manager_epv->getsgl)(index_);
- bound=0;
-
- causes "error 1527: Incompatible types in cast.". I am using 8.07
- with the ANSI mode on the compiler.
-
- I must say that I think the semantics of [last_is(x)] are entirely
- broken for C, which has 0-based arrays and not 1-based arrays like
- Pascal. If it had been [size_is(x)] instead, this would work
- independent of the array index-basing.
-
- I guess this bug is a bit particular, so please respond to me
- privately...
-
- Thanks,
-
- -Philip <philipp@res.enst.fr>
-