[omniORB] Strange code produced by omniidl2

David.Chung@USPTO.GOV David.Chung@USPTO.GOV
Wed, 7 Jul 1999 14:51:20 -0400


	My earlier e-mail made embarassing statements  -- I must have been
qute confused.
	
	IDL doesnot permit forward declarations for anything except
interfaces.  
As it stands, you are trying to forward declare bs module.  So, it won't
compile.  
[see, p. 74 of "Advanced CORBA Programming with C++", by Henning and
Vinoski].
	
	

> -----Original Message-----
> From:	ncb@adaptivebroadband.com [SMTP:ncb@adaptivebroadband.com]
> Sent:	Wednesday, July 07, 1999 9:14 AM
> To:	Chung, David
> Cc:	omniorb-list@uk.research.att.com
> Subject:	Re: [omniORB] Strange code produced by omniidl2
> 
> David.Chung@USPTO.GOV wrote:
> > 
> >         (1) if you look at the file weird.idl, bs module precedes the ap
> > module.
> > This is necessary, because the symbol "bs" within ap module would not be
> a
> > valid reference.
> > It is not necessary for a forward declaration to be at the beginning of
> a
> > file, as long as
> > the forward declaration precedes the reference which could generate
> compiler
> > error.
> > 
> >         (2) the forward declaration of ap in odd.idl is not necessary
> for
> > weird.idl, because
> > weird.idl declares it again.  In short, weird.idl would compile without
> > odd.idl.
> > 
> >         "odd.idl" seems to be an insurance header file that forward
> declares
> > ap modules,
> > to be included in those idl's that reference ap module in one of the
> > modules.  But including
> > odd.idl does not hurt weird.idl's chances of proper compilation.
> > 
> >         In summary, there is no bug.
> > 
> Thanks for the reply.
> 
> (1) Yup, but the problem is that the bs::node get_node() method in
> weird.idl requires a declaration of bs::node. But this declaration in
> the .hh is produced at the end of the file, and so any .cc file that
> includes weird.hh won't compile.
> 
> (2) I think the problem here is that I've cut the IDL down to the bare
> minimum. In my actual su.idl file I have a sufactory::create_su(in
> string name, in ap::node ap_ptr) method. I can't #include "weird.idl"
> here because they are mutually dependent. I've included new copies of
> weird.idl and weirdsu.idl that illustrate this.
> 
> If I put the forward reference of bs::node BEFORE the #include
> "weirdsu.idl" then it produces correct weird.hh i.e. bs::node appears
> before ap::node.
> 
> Cheers, 
> 	Nick << File: weird.idl >>  << File: weirdsu.idl >>