[omniORB] Strange code produced by omniidl2
David.Chung@USPTO.GOV
David.Chung@USPTO.GOV
Wed, 7 Jul 1999 08:38:42 -0400
(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.
-- My opinions, of course, are handed out with full disclaimers in
case
I do not have all the facts and/or I was zoning out of reality when I wrote
this e-mail --
which is probably the case, as I should be doing real work, not reading
omniorb
e-mails at this moment.
> -----Original Message-----
> From: ncb@adaptivebroadband.com [SMTP:ncb@adaptivebroadband.com]
> Sent: Wednesday, July 07, 1999 5:49 AM
> To: omniorb-list@uk.research.att.com
> Subject: [omniORB] Strange code produced by omniidl2
>
> I'm having a problem with forward declarations. Basically I have the
> following two idl files:
>
> weird.idl:
>
> #ifndef _weird_idl_
> #define _weird_idl_
>
> #include "odd.idl"
>
> module bs
> {
> interface node;
> };
>
> module ap
> {
> interface node
> {
> bs::node get_node();
> };
> };
>
> #endif
>
> and
>
> odd.idl:
>
> #ifndef _odd_idl_
> #define _odd_idl_
>
> module ap
> {
> interface node;
> };
>
> module su
> {
> interface node
> {
> string get_name();
> };
> };
>
> #endif // _su_idl_
>
>
> Now the weird thing is that if you look at weird.hh the forward
> declaration for the bs module is at THE END of the file (which isn't
> much use in a forward declaration!). Stranger still, the ap module is at
> the start of the file for odd.hh, where it should be.
>
> This looks like a bug in omniidl2. Any ideas?
>
> Cheers,
> Nick Brook
> AdaptiveBroadband Ltd,
> Cambridge
> UK