[omniORB] Big unsigned long constants in IDL

Leandro Fanzone leandro@hasar.com
Tue Oct 8 18:15:02 2002


Hello. When using the following declaration in an IDL

   const unsigned long SOME_CONSTANT = 0xFFFFFFFF;

the generated code (omniORB 3.0.4) in C++ is

   static _code_attr const CORBA::ULong NOT_SPECIFIED _init_in_cldecl_( 
= 4294967295 );

which is apparently correct, but the compiler (gcc 3.1 on Linux) complains:

   warning: decimal constant is so large that it is unsigned.

That can be fixed if the generated code uses hexadecimal output (treated 
as unsigned for the compiler) or with the U at the end of it 
(4294967295U). I don't know if this is a problem of a too strict 
compiler (after all there's nothing wrong on assigning such a number to 
an unsigned constant) or it's really an ANSI issue and must be fixed on 
the IDL compiler.
Any insights?

Leandro Fanzone