[omniORB] clang compiler warning in omniidl generated code
Duncan Grisby
duncan at grisby.org
Thu Apr 26 15:44:16 BST 2018
On Thu, 2018-04-26 at 16:03 +0200, Peter Klotz via omniORB-list wrote:
> IdlTypes.cpp:13:20: warning: unused variable '_0RL_library_version'
> [-Wunused-variable]
> static const char* _0RL_library_version = omniORB_4_2;
> ^
> 1 warning generated.
> --------------------
>
> A simple omniidl patch silenced the warning but the question came up
> what the variable is for.
> The code seems fine without. It is not referenced or checked
> anywhere.
> What purpose does it serve?
It saves you from trying to use stubs that were generated for omniORB
4.2 against any other version of the omniORB libraries. The omniORB 4.2
library exports the symbol omniORB_4_2. If you try to compile or link
your generated stubs with omniORB 4.1.x, for example, the symbol will
be missing and the compiler or linker will complain.
It's unfortunate that clang warns about it. I'm not sure what can be
done about that.
Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the omniORB-list
mailing list