[omniORB] VC6.0 gives warning C4097

jon.kristensen@kongsberg-simrad.com jon.kristensen@kongsberg-simrad.com
Wed, 30 Jan 2002 08:55:43 +0100


I do not want to start a big discussion on this, and I do not have any
problems with disabling some of these warnings. The purpose of my initial
email was to query about your general policy about warnings, and thus if
you wanted some feedback on the actual warnings beeing generated to allow
you to remove them on future releases. It would be better if these warnings
were disabled in CORBA_sysdeb.h (as you have already started to do) rather
than manally by eah developer using omniORB.

However (for the sake of the argument) with regards to C4097, I found the
following text in the MSDN library:

   This error message is correct in accordance with the C++ language
   specification. In C++ grammar, the "base-list" is specified as being a
   list of "base-specifiers". A base-specifier reduces to a
   "complete-class-name", which does not include "typedef-names".
   Consequently, the compiler is perfectly correct in generating this
   warning/error for the sample below.

I do not (yet) have a copy of the ARM, but when looking at the grammar in
the MSDN reference, I think that MS are correct.

Thanks for quick feedback anyway.

Regards,
Jon.
--------------
Jon Kristensen
Principal Engineer, SW Embedded Systems
Kongsberg Simrad AS, Horten, Norway
email:    jon.kristensen@kongsberg-simrad.com




Duncan Grisby <dgrisby@uk.research.att.com>@uk.research.att.com on
29.01.2002 12:24:24
Internet mail from:

Sent by:  dpg1@uk.research.att.com

To:   jon.kristensen@kongsberg-simrad.com
cc:   omniorb-list@uk.research.att.com

Subject:  Re: [omniORB] VC6.0 gives warning C4097


On Thursday 24 January, jon.kristensen@kongsberg-simrad.com wrote:

> I am now trying omniORB 4.0, and when compiling with warning level 4 and
> above, I get a huge amount of warnings like:
>
> d:\omni\include\omniorb4\seqtemplatedecls.h(602) : warning C4097:
> typedef-name 'Base_T_seq' used as synonym for class-name '

I've looked up the warning on MSDN, and the write-up is rather
incomprehensible. The code is the way it is for clarity. I don't think
it's invalid.

> d:\omni\include\omnithread.h(622) : warning C4511: 'omni_thread' :
> copy constructor could not be generated
>         d:\omni\include\omnithread.h(364) : see declaration of
'omni_thread'

This one is probably fixable by declaring a private copy constructor.
I'll have to think about whether that will break anything.

> d:\omni\include\omnithread.h(558) : warning C4100: 'arg' :
> unreferenced formal parameter

Those are easy to eliminate by removing the arg argument name.

> What is the omniORB philosophy on this?

We generally like to remove as many warnings as possible, as long as
it doesn't compromise code clarity or performance. There is a limit on
how far it is sensible to go, though. One option for you to get rid of
all your warnings is to add pragmas to suppress them. If you look at
include/omniORB4/CORBA_sysdep.h, you'll see a couple of suppressed
warnings for VC++ already.

Cheers,

Duncan.

--
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --