[omniORB] How to avoid compile warnings

Andrey Koubychev email@vtc.ru
Wed Jul 10 12:02:44 2002


Hello omniorb-listers,

I would like to avoid annoying warning with gcc 2.95.3 when compiling
following code :


in definition
class BaseModule {....
PortableServer::ObjectId_var o_id;
....
}
in Start member
        poa->activate_object_with_id(o_id,this);

in dctor
        poa->deactivate_object (o_id);


Warnings i get :

BaseModule.cpp: In method `void BaseModule::Start(bool = true)':
BaseModule.cpp:208: warning: choosing `PortableServer::ObjectId_var::operator Po
rtableServer::ObjectId &()' over `PortableServer::ObjectId_var::operator const P
ortableServer::ObjectId &() const'
BaseModule.cpp:208: warning:   for conversion from `PortableServer::ObjectId_var
' to `const PortableServer::ObjectId &'
BaseModule.cpp:208: warning:   because conversion sequence for the argument is b
etter
BaseModule.cpp: In method `BaseModule::~BaseModule()':
BaseModule.cpp:272: warning: choosing `PortableServer::ObjectId_var::operator Po
rtableServer::ObjectId &()' over `PortableServer::ObjectId_var::operator const P
ortableServer::ObjectId &() const'
BaseModule.cpp:272: warning:   for conversion from `PortableServer::ObjectId_var
' to `const PortableServer::ObjectId &'
BaseModule.cpp:272: warning:   because conversion sequence for the argument is b
etter


-- 
Best regards,
 Andrey                          mailto:email@vtc.ru