Schmidt Thomas
2008-12-22 12:06:24 UTC
Hi,
I just compiled Mico 2.3.13 on MacOS X 10.4.11 (PPC) using gcc 4.0.1.
After looking at some compiler warnings/errors I fixed some of them
and have questions about some others:
1. /Users/tcs/src/CORBA/mico/coss/time/TimeService_impl.cc
TimeService_impl::universal_time(): Variable 'timeV' will be
used uninitialized! I don't know how to
fix.
2. /Users/tcs/src/CORBA/mico/coss/relship/RandomGenerator_impl.cc
RandomGenerator_impl::rand(): Value of variable 'number' may be
returned uninitialized. This may
in fact happen only on errors. F.e. an illegal 'mode' value.
Three ways to resolve:
a. Put body of the second 'if'-statement into the firsts 'else'-
part.
b. Report an error or raise an exception if 'mode' containes an
unexpected value.
c. Set 'number' to a defined value, f.e. 0.
d. Initialize 'number' to any defined value. This may especially
be useful in case of detecting empty
'random_numbers' to avoid compiler warning.
3. /Users/tcs/src/CORBA/mico/coss/relship/randomd.cc
main(): Variable 'generator' should be initialized.
4. /Users/tcs/src/CORBA/mico/demo/services/naming-lb/Printer_impl.cc
Printer_impl::~Printer_impl(): The printf-statement lacks its
string argument. It should be written as
printf ("-- printer %s is destroyed\n", printerName);
5. /Users/tcs/src/CORBA/mico/coss/naming/Naming_impl.cc
NamingContext_impl::restore(): 'binding.btype' may be used
uninitialized. Its value will be
assigned near end of the function depending on variable 'type'.
What should happen if 'type' is
neither "ncontext:" nor "nobject:"?
6. /Users/tcs/src/CORBA/mico/include/coss/NamedRoleTypesHelper.h
/Users/tcs/src/CORBA/mico/include/coss/InterfaceDefsHelper.h
/Users/tcs/src/CORBA/mico/include/coss/ GraphsRole_impl.h
Preprocessor include directive should be fixed to:
#include "coss/CosRelationships.h"
#include "coss/CosGraphs.h"
#include "coss/Role_impl.h"
7. /Users/tcs/src/CORBA/mico/coss/relship/GraphsRole_impl.cc
CosGraphs_impl::Role_impl::Role_impl(): Initialization should be
reordered like:
CosGraphs_impl::Role_impl::Role_impl
(CosRelationships::RelatedObject_ptr obj)
: ::Role_impl (), POA_CosGraphs::Role ()
8. My compiler reports lots of (f.e. containmentd.cc:47 + 52)
"deprecated conversion from string constant to 'char*''
9. coss/relship will not generate the library stuff when being
configured with option '--enable-final'.
Mico installs well. Now trying out test suite and demos...
Ciao
Thomas
--
Thomas Schmidt
Schneiderstr. 16
D-29575 Altenmedingen
Phone: +49-5807-209976
Cellular: +49-172-3011505
Skype: ThCSchmidt
Email: ***@vodafone.de
PGP: Key-ID: 0x810B6206
I just compiled Mico 2.3.13 on MacOS X 10.4.11 (PPC) using gcc 4.0.1.
After looking at some compiler warnings/errors I fixed some of them
and have questions about some others:
1. /Users/tcs/src/CORBA/mico/coss/time/TimeService_impl.cc
TimeService_impl::universal_time(): Variable 'timeV' will be
used uninitialized! I don't know how to
fix.
2. /Users/tcs/src/CORBA/mico/coss/relship/RandomGenerator_impl.cc
RandomGenerator_impl::rand(): Value of variable 'number' may be
returned uninitialized. This may
in fact happen only on errors. F.e. an illegal 'mode' value.
Three ways to resolve:
a. Put body of the second 'if'-statement into the firsts 'else'-
part.
b. Report an error or raise an exception if 'mode' containes an
unexpected value.
c. Set 'number' to a defined value, f.e. 0.
d. Initialize 'number' to any defined value. This may especially
be useful in case of detecting empty
'random_numbers' to avoid compiler warning.
3. /Users/tcs/src/CORBA/mico/coss/relship/randomd.cc
main(): Variable 'generator' should be initialized.
4. /Users/tcs/src/CORBA/mico/demo/services/naming-lb/Printer_impl.cc
Printer_impl::~Printer_impl(): The printf-statement lacks its
string argument. It should be written as
printf ("-- printer %s is destroyed\n", printerName);
5. /Users/tcs/src/CORBA/mico/coss/naming/Naming_impl.cc
NamingContext_impl::restore(): 'binding.btype' may be used
uninitialized. Its value will be
assigned near end of the function depending on variable 'type'.
What should happen if 'type' is
neither "ncontext:" nor "nobject:"?
6. /Users/tcs/src/CORBA/mico/include/coss/NamedRoleTypesHelper.h
/Users/tcs/src/CORBA/mico/include/coss/InterfaceDefsHelper.h
/Users/tcs/src/CORBA/mico/include/coss/ GraphsRole_impl.h
Preprocessor include directive should be fixed to:
#include "coss/CosRelationships.h"
#include "coss/CosGraphs.h"
#include "coss/Role_impl.h"
7. /Users/tcs/src/CORBA/mico/coss/relship/GraphsRole_impl.cc
CosGraphs_impl::Role_impl::Role_impl(): Initialization should be
reordered like:
CosGraphs_impl::Role_impl::Role_impl
(CosRelationships::RelatedObject_ptr obj)
: ::Role_impl (), POA_CosGraphs::Role ()
8. My compiler reports lots of (f.e. containmentd.cc:47 + 52)
"deprecated conversion from string constant to 'char*''
9. coss/relship will not generate the library stuff when being
configured with option '--enable-final'.
Mico installs well. Now trying out test suite and demos...
Ciao
Thomas
--
Thomas Schmidt
Schneiderstr. 16
D-29575 Altenmedingen
Phone: +49-5807-209976
Cellular: +49-172-3011505
Skype: ThCSchmidt
Email: ***@vodafone.de
PGP: Key-ID: 0x810B6206