[omniORB] Possible problem with omniidl2 and module names
Sai-Lai Lo
S.Lo@uk.research.att.com
29 Sep 1999 16:54:18 +0100
>>>>> Craig Rodrigues writes:
> I just tried something with omniidl2 in
> omniORB 2.8.0, and
> I suspect that it may violate one of the
> Scoping Rules of the CORBA 2.3 specification.
> The following code compiles under omniidl2:
> module a{
> interface a{
> };
> };
> Opinions?
Yes, I'm aware of that. In fact, there are 7 outstanding cases in the scoping
rules that omniidl2 does not flag as error. All of them related to the
newly defined scoping rule in 2.3. I'm not going to modify the current
omniidl2 frontend to flag the errors because to do would require more dirty
hacks to the very old frontend. A rewrite of the frontend is in
progress. This new frontend has a python backend interface so that
different backends can be written in python. The new frontend will honour
the new scoping rules.
FYI, the following are the cases where omniidl2 should have flagged as
errors:
--------------------------------------
interface A {
typedef string string_t;
};
interface B {
typedef string<128> string_t;
};
interface C : A, B {
#if defined(ERROR_TEST) && ERROR_TEST == 1
attribute string_t Title;
#endif
};
------------------------------------------
--------------------------------------------
module M {
#if defined(ERROR_TEST) && ERROR_TEST == 1
typedef short M; // Error: M is the name of the module
#endif
interface I {
#if defined(ERROR_TEST) && ERROR_TEST == 2
void i (in short j); // Error: i clashes with the interface name I
#endif
};
};
--------------------------------------------------
module M {
typedef long ArgType;
const long l = 10;
typedef short Y;
interface A {
struct S {
ArgType x[l];
long y;
};
#if defined (ERROR_TEST) && ERROR_TEST == 1
typedef string ArgType;
#endif
#if defined (ERROR_TEST) && ERROR_TEST == 2
enum l { l1, l2 };
#endif
typedef short Y;
};
};
---------------------------------------------------
---------------------------------------------------
module M {
module Inner1 {
typedef string S1;
};
module Inner3 {
typedef Inner1::S1 S2;
#if defined(ERROR_TEST) && ERROR_TEST == 1
typedef string inner1; // Error
#endif
typedef string S1;
};
};
---------------------------------------------------
--------------------------------------------------
module M {
#if defined(ERROR_TEST) && ERROR_TEST == 1
typedef long Long; // Error: Long clashes with keyword long
#endif
};
};
-----------------------------------------------
--
Sai-Lai Lo S.Lo@uk.research.att.com
AT&T Laboratories Cambridge WWW: http://www.uk.research.att.com
24a Trumpington Street Tel: +44 1223 343000
Cambridge CB2 1QA Fax: +44 1223 313542
ENGLAND