Compiler warnings and stuff



G'day ORBit gurus,

I'm building ORBit-C++ (http://orbitcpp.sourceforge.net/) against ORBit
0.5.12-1 on Debian, and I keep getting a bunch of warnings from the
compiler for both code generated by orbit-idl and the headers included
with ORBit.

This message is kind of long; sorry.



First, generated code. There are a whole bunch of warnings that follow
the form:

everything-common.c: In function `test_FixedLengthStruct__free':
everything-common.c:2616: warning: unused parameter `dat'
everything-common.c:2617: warning: unused parameter `free_strings'

The code it's complaining about is:

gpointer
test_FixedLengthStruct__free(gpointer mem, gpointer dat,
	                 CORBA_boolean free_strings)
{
	test_FixedLengthStruct *var = mem;

	return (gpointer) (var + 1);
}

These warnings could be made to go away by adding lines like the
following to the generated code:

(void) dat;
(void) free_strings;

These seem to be emitted for each __free() function defined in the
generated code.

I get warnings of the same kind (unused parameters) from some other
functions too:

any-skels.c: In function `get_skel_test_SomeObj':
any-skels.c:45: warning: unused parameter `servant'
any-skels.c:46: warning: unused parameter `impl'



I'm also getting the following warning:

basic-stubs.c: In function `Test_BaseB_throwException':
basic-stubs.c:428: warning: ANSI forbids initialization between function
pointer and `void *'

The corresponding code is:

void
Test_BaseB_throwException(Test_BaseB _obj, CORBA_Environment * ev)
{
	static const ORBit_exception_demarshal_info _ORBIT_user_exceptions[] =
		{ {(const CORBA_TypeCode) &TC_Test_Scoping_Failure_struct,
			  (gpointer) _ORBIT_Test_Scoping_Failure_demarshal},
			  {CORBA_OBJECT_NIL, NULL}
		};

I don't have a solution for this one. A cast, maybe?



Now, I'm also getting warnings about some of the header files included
in ORBit:

/usr/include/orbit-1.0/orb/env.h:51: warning: non-static const member
`struct CORBA_TypeCode_struct *const {anonymous struct}::tc' in class
without a constructor

I realise this is because I'm compiling C++ code which includes the C
header files, but it's nice to have C headers be C++ compatible so they
can actually be used in this way.

I don't have a solution to this one either.



I also have:

/usr/include/orbit-1.0/orb/allocator-defs.h:36: warning: ANSI C does not
allow extra `;' outside of a function

This seems to be because EXTERN_LOCK(x) is #defined to nothing, and is
used with a trailing semicolon in allocator-defs.h.

I don't have a solution to this one either.



And finally, I have:

/usr/include/orbit-1.0/orb/corba_typecode.h:62: warning: ANSI C
restricts enumerator values to range of `int'

This is because the last member of that enumeration is defined as:

	CORBA_tk_recursive=0xffffffff

The solution to this is probably to #include <limits.h> and use INT_MAX
instead of 0xffffffff as the value for that member.
-- 
Sam Couter          |   Internet Engineer   |   http://www.topic.com.au/
sam@topic.com.au    |   tSA Consulting      |
OpenPGP key ID:       DE89C75C,  available on key servers
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C

PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]