Discussion:
[omniORB] Visual Studio 2008 level 4 compiler warnings
Richard Pitts
2012-05-02 17:12:05 UTC
Permalink
Hi



We are using OmniORB 4.1.5 for Visual Studio 2008 and have recently
changed our compiler warning level to 4 (highest). Unfortunately the
compiler is reporting a lot of C4127 and C4512 warnings for OmniORB. We
appreciate these are not important but it would be nice to compile
against OmniORB warning free.



The following warnings are because of the do { } while(0); loops in the
marshalling methods. Most are because of the CdrMarshal and CdrUnMarshal
macros (line 236 and 256).



3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(331)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(346)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(352)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(357)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(589)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(606)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(975)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(979)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(991)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(995)
: warning C4127: conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1007) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1011) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1023) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1027) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1040) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1044) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1056) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1060) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1075) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1080) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1103) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1108) : warning C4127:
conditional expression is constant



These warnings are because of the reference member variable within each
of the classes/structs.



3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1404) : warning C4512:
'cdrStreamAdapter' : assignment operator could not be generated

3> C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1328) : see declaration
of 'cdrStreamAdapter'

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1562) : warning C4512:
'cdrValueChunkStream' : assignment operator could not be generated

3> C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1416) : see declaration
of 'cdrValueChunkStream'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Object_vartypes.h(313) :
warning C4512: 'CORBA::Object_INOUT_arg' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Object_vartypes.h(290) : see
declaration of 'CORBA::Object_INOUT_arg'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_LocalObject_vartypes.h(295) :
warning C4512: 'CORBA::LocalObject_INOUT_arg' : assignment operator
could not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_LocalObject_vartypes.h(272) :
see declaration of 'CORBA::LocalObject_INOUT_arg'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(152)
: warning C4512: 'CORBA::Any::from_fixed' : assignment operator could
not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(145) : see declaration
of 'CORBA::Any::from_fixed'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(189)
: warning C4512: 'CORBA::Any::to_boolean' : assignment operator could
not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(186) : see declaration
of 'CORBA::Any::to_boolean'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(193)
: warning C4512: 'CORBA::Any::to_char' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(190) : see declaration
of 'CORBA::Any::to_char'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(197)
: warning C4512: 'CORBA::Any::to_wchar' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(194) : see declaration
of 'CORBA::Any::to_wchar'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(201)
: warning C4512: 'CORBA::Any::to_octet' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(198) : see declaration
of 'CORBA::Any::to_octet'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(210)
: warning C4512: 'CORBA::Any::to_string' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(202) : see declaration
of 'CORBA::Any::to_string'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(219)
: warning C4512: 'CORBA::Any::to_wstring' : assignment operator could
not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(211) : see declaration
of 'CORBA::Any::to_wstring'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(227)
: warning C4512: 'CORBA::Any::to_fixed' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(220) : see declaration
of 'CORBA::Any::to_fixed'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(231)
: warning C4512: 'CORBA::Any::to_object' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(228) : see declaration
of 'CORBA::Any::to_object'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(235)
: warning C4512: 'CORBA::Any::to_abstract_base' : assignment operator
could not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(232) : see declaration
of 'CORBA::Any::to_abstract_base'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(239)
: warning C4512: 'CORBA::Any::to_value' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(236) : see declaration
of 'CORBA::Any::to_value'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_ValueBase_vartypes.h(314) :
warning C4512: 'CORBA::ValueBase_INOUT_arg' : assignment operator could
not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_ValueBase_vartypes.h(290) :
see declaration of 'CORBA::ValueBase_INOUT_arg'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_vartypes.h(148) : warning
C4512: 'CORBA::TypeCode_INOUT_arg' : assignment operator could not be
generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_vartypes.h(135) : see
declaration of 'CORBA::TypeCode_INOUT_arg'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_vartypes.h(182) : warning
C4512: 'CORBA::TypeCode_OUT_arg' : assignment operator could not be
generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_vartypes.h(154) : see
declaration of 'CORBA::TypeCode_OUT_arg'



Kind Regards



Richard Pitts

Windows Developer

CDL



</PRE>
<p style="font-family:'Arial';font-size:8pt">
**********************************************************************<br>
Please consider the environment - do you really need to print this email?<br>
<br>
This email is intended only for the person(s) named above and may contain private and confidential information. If it has come to you in error, please destroy and permanently delete any copy in your possession and contact us on +44 (0) 161 480 4420. The information in this email is copyright &copy; CDL Group Holdings Limited. We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before opening any attachment.<br>
Cheshire Datasystems Limited uses software which automatically screens incoming emails for inappropriate content and attachments. If the software identifies such content or attachment, the email will be forwarded to our Technology Department for checking. You should be aware that any email which you send to Cheshire Datasystems Limited is subject to this procedure. <br>
Cheshire Datasystems Limited, Strata House, Kings Reach Road, Stockport SK4 2HD<br>
Registered in England and Wales with Company Number 3991057<br>
VAT registration: 727 1188 33</p>
<PRE>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20120502/8e4f31ff/attachment-0001.htm
Martin B.
2012-05-03 00:24:16 UTC
Permalink
Post by Richard Pitts
Hi
We are using OmniORB 4.1.5 for Visual Studio 2008 and have recently
changed our compiler warning level to 4 (highest). Unfortunately the
compiler is reporting a lot of C4127 and C4512 warnings for OmniORB. We
appreciate these are not important but it would be nice to compile
against OmniORB warning free.
I guess omniORB is just the tip of the iceberg.

Personally, I consider Warning Level 4 to be pretty impractical exactly
because of these annoyances with basically all 3rd party libs I ever
encountered. I rather prefer to just enable a very few select L4 warnings.

Not sayin' omniORB's sources couldn't be improved there, ... I've also
asked for something rather similar a while back
(http://www.omniorb-support.com/pipermail/omniorb-list/2010-July/030672.html)
... and then shame on me didn't get round to put a patch together.

cheers,
Martin
Richard Pitts
2012-05-04 15:19:57 UTC
Permalink
Hi



I've created a patch for cdrStream.h on trunk to resolve the C4127
warnings. The patch removes the CdrMarshal and CdrUnMarshal macros and
place the definitions in macro intMarshalFns.



Any suggestions welcome and feel free to make any changes. I'm hoping
this can be in the 4.1.7 release.



Index: cdrStream.h

===================================================================

--- cdrStream.h (revision 6094)

+++ cdrStream.h (working copy)

@@ -56,51 +56,6 @@

virtual ~cdrStream();

//

- // Marshalling macros

-

-#ifndef CdrMarshal

-#define CdrMarshal(type,align,reserveAndMarshal,arg) do { \

- omni::ptr_arith_t p1 =
omni::align_to((omni::ptr_arith_t)pd_outb_mkr,align);\

- omni::ptr_arith_t p2 = p1 + sizeof(type);\

- if ((void*)p2 <= pd_outb_end) {\

- pd_outb_mkr = (void*) p2;\

- if (!pd_marshal_byte_swap) {\

- *((type*)p1) = arg;\

- }\

- else {\

- *((type*)p1) = byteSwap(arg);\

- }\

- }\

- else {\

- reserveAndMarshal(arg);\

- }\

-} while(0)

-#else

-#error "CdrMarshal has already been defined"

-#endif

-

-#ifndef CdrUnMarshal

-#define CdrUnMarshal(type,align,fetchAndUnmarshal,arg) do { \

- omni::ptr_arith_t p1 =
omni::align_to((omni::ptr_arith_t)pd_inb_mkr,align);\

- omni::ptr_arith_t p2 = p1 + sizeof(type);\

- if ((void*)p2 <= pd_inb_end) {\

- pd_inb_mkr = (void*) p2;\

- if (!pd_unmarshal_byte_swap) {\

- arg = *((type*)p1);\

- }\

- else {\

- arg = byteSwap(*((type*)p1));\

- }\

- }\

- else {\

- arg = fetchAndUnmarshal();\

- }\

-} while(0)

-#else

-#error "CdrUnMarshal has already been defined"

-#endif

-

- //

// Byte swapping functions

static inline _CORBA_Short byteSwap(_CORBA_Short s) {

@@ -213,12 +168,38 @@

// Marshalling methods : integer types

#define intMarshalFns(type,align) \

- inline void marshal ## type(_CORBA_ ## type a) { \

- CdrMarshal(_CORBA_ ## type, omni::align, reserveAndMarshal ## type,
a); \

- } \

+ inline void marshal ## type(_CORBA_ ## type arg) { \

+ omni::ptr_arith_t p1 =
omni::align_to((omni::ptr_arith_t)pd_outb_mkr,omni::align); \

+ omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_ ## type);\

+ if ((void*)p2 <= pd_outb_end) {\

+ pd_outb_mkr = (void*) p2;\

+ if (!pd_marshal_byte_swap) {\

+ *((_CORBA_ ## type*)p1) = arg;\

+ }\

+ else {\

+ *((_CORBA_ ## type*)p1) = byteSwap(arg);\

+ }\

+ }\

+ else {\

+ reserveAndMarshal ## type(arg);\

+ }\

+ }\

inline _CORBA_ ## type unmarshal ## type() { \

_CORBA_ ## type a; \

- CdrUnMarshal(_CORBA_ ## type, omni::align, fetchAndUnmarshal ##
type , a); \

+ omni::ptr_arith_t p1 =
omni::align_to((omni::ptr_arith_t)pd_inb_mkr,omni::align); \

+ omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_ ## type);\

+ if ((void*)p2 <= pd_inb_end) {\

+ pd_inb_mkr = (void*) p2;\

+ if (!pd_unmarshal_byte_swap) {\

+ a = *((_CORBA_ ## type*)p1);\

+ }\

+ else {\

+ a = byteSwap(*((_CORBA_ ## type*)p1));\

+ }\

+ }\

+ else {\

+ a = fetchAndUnmarshal ## type();\

+ }\

return a; \

}



Kind Regards



Richard Pitts

Windows Developer

CDL



From: omniorb-list-***@omniorb-support.com
[mailto:omniorb-list-***@omniorb-support.com] On Behalf Of Richard
Pitts
Sent: 02 May 2012 12:12
To: omniorb-***@omniorb-support.com
Subject: [omniORB] Visual Studio 2008 level 4 compiler warnings



Hi



We are using OmniORB 4.1.5 for Visual Studio 2008 and have recently
changed our compiler warning level to 4 (highest). Unfortunately the
compiler is reporting a lot of C4127 and C4512 warnings for OmniORB. We
appreciate these are not important but it would be nice to compile
against OmniORB warning free.



The following warnings are because of the do { } while(0); loops in the
marshalling methods. Most are because of the CdrMarshal and CdrUnMarshal
macros (line 236 and 256).



3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(331)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(346)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(352)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(357)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(589)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(606)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(975)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(979)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(991)
: warning C4127: conditional expression is constant

3>C:\Program Files (x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(995)
: warning C4127: conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1007) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1011) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1023) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1027) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1040) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1044) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1056) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1060) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1075) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1080) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1103) : warning C4127:
conditional expression is constant

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1108) : warning C4127:
conditional expression is constant



These warnings are because of the reference member variable within each
of the classes/structs.



3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1404) : warning C4512:
'cdrStreamAdapter' : assignment operator could not be generated

3> C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1328) : see declaration
of 'cdrStreamAdapter'

3>C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1562) : warning C4512:
'cdrValueChunkStream' : assignment operator could not be generated

3> C:\Program Files
(x86)\omniORB-4.1.5\include\omniORB4/cdrStream.h(1416) : see declaration
of 'cdrValueChunkStream'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Object_vartypes.h(313) :
warning C4512: 'CORBA::Object_INOUT_arg' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Object_vartypes.h(290) : see
declaration of 'CORBA::Object_INOUT_arg'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_LocalObject_vartypes.h(295) :
warning C4512: 'CORBA::LocalObject_INOUT_arg' : assignment operator
could not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_LocalObject_vartypes.h(272) :
see declaration of 'CORBA::LocalObject_INOUT_arg'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(152)
: warning C4512: 'CORBA::Any::from_fixed' : assignment operator could
not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(145) : see declaration
of 'CORBA::Any::from_fixed'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(189)
: warning C4512: 'CORBA::Any::to_boolean' : assignment operator could
not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(186) : see declaration
of 'CORBA::Any::to_boolean'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(193)
: warning C4512: 'CORBA::Any::to_char' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(190) : see declaration
of 'CORBA::Any::to_char'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(197)
: warning C4512: 'CORBA::Any::to_wchar' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(194) : see declaration
of 'CORBA::Any::to_wchar'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(201)
: warning C4512: 'CORBA::Any::to_octet' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(198) : see declaration
of 'CORBA::Any::to_octet'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(210)
: warning C4512: 'CORBA::Any::to_string' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(202) : see declaration
of 'CORBA::Any::to_string'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(219)
: warning C4512: 'CORBA::Any::to_wstring' : assignment operator could
not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(211) : see declaration
of 'CORBA::Any::to_wstring'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(227)
: warning C4512: 'CORBA::Any::to_fixed' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(220) : see declaration
of 'CORBA::Any::to_fixed'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(231)
: warning C4512: 'CORBA::Any::to_object' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(228) : see declaration
of 'CORBA::Any::to_object'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(235)
: warning C4512: 'CORBA::Any::to_abstract_base' : assignment operator
could not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(232) : see declaration
of 'CORBA::Any::to_abstract_base'

3>c:\program files (x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(239)
: warning C4512: 'CORBA::Any::to_value' : assignment operator could not
be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_Any.h(236) : see declaration
of 'CORBA::Any::to_value'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_ValueBase_vartypes.h(314) :
warning C4512: 'CORBA::ValueBase_INOUT_arg' : assignment operator could
not be generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_ValueBase_vartypes.h(290) :
see declaration of 'CORBA::ValueBase_INOUT_arg'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_vartypes.h(148) : warning
C4512: 'CORBA::TypeCode_INOUT_arg' : assignment operator could not be
generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_vartypes.h(135) : see
declaration of 'CORBA::TypeCode_INOUT_arg'

3>c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_vartypes.h(182) : warning
C4512: 'CORBA::TypeCode_OUT_arg' : assignment operator could not be
generated

3> c:\program files
(x86)\omniorb-4.1.5\include\omniorb4\CORBA_vartypes.h(154) : see
declaration of 'CORBA::TypeCode_OUT_arg'



Kind Regards



Richard Pitts

Windows Developer

CDL



**********************************************************************
Please consider the environment - do you really need to print this
email?

This email is intended only for the person(s) named above and may
contain private and confidential information. If it has come to you in
error, please destroy and permanently delete any copy in your possession
and contact us on +44 (0) 161 480 4420. The information in this email is
copyright (c) CDL Group Holdings Limited. We cannot accept any liability
for any loss or damage sustained as a result of software viruses. It is
your responsibility to carry out such virus checking as is necessary
before opening any attachment.
Cheshire Datasystems Limited uses software which automatically screens
incoming emails for inappropriate content and attachments. If the
software identifies such content or attachment, the email will be
forwarded to our Technology Department for checking. You should be aware
that any email which you send to Cheshire Datasystems Limited is subject
to this procedure.
Cheshire Datasystems Limited, Strata House, Kings Reach Road, Stockport
SK4 2HD
Registered in England and Wales with Company Number 3991057
VAT registration: 727 1188 33


</PRE>
<p style="font-family:'Arial';font-size:8pt">
**********************************************************************<br>
Please consider the environment - do you really need to print this email?<br>
<br>
This email is intended only for the person(s) named above and may contain private and confidential information. If it has come to you in error, please destroy and permanently delete any copy in your possession and contact us on +44 (0) 161 480 4420. The information in this email is copyright &copy; CDL Group Holdings Limited. We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before opening any attachment.<br>
Cheshire Datasystems Limited uses software which automatically screens incoming emails for inappropriate content and attachments. If the software identifies such content or attachment, the email will be forwarded to our Technology Department for checking. You should be aware that any email which you send to Cheshire Datasystems Limited is subject to this procedure. <br>
Cheshire Datasystems Limited, Strata House, Kings Reach Road, Stockport SK4 2HD<br>
Registered in England and Wales with Company Number 3991057<br>
VAT registration: 727 1188 33</p>
<PRE>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20120504/bb9f8ba0/attachment-0001.htm
Duncan Grisby
2012-05-04 15:44:17 UTC
Permalink
I?ve created a patch for cdrStream.h on trunk to resolve the C4127
warnings. The patch removes the CdrMarshal and CdrUnMarshal macros and
place the definitions in macro intMarshalFns.
Thanks for the patch. It makes sense for trunk, and I'll put something
along those lines in. Perhaps you can send it again as an attachment,
because it has become a bit mangled in the email body?
Any suggestions welcome and feel free to make any changes. I?m hoping
this can be in the 4.1.7 release.
I'm afraid it can't be in the 4.1.7 release. The cdrStream layout is
quite different in trunk (which will be the 4.2.x release) to what's in
4.1.x. The 4.2.x version can't be back-ported to 4.1.x because it's
binary incompatible. 4.1.x uses the CdrMarshal and CdrUnmarshal macros
rather more.

Anyway, I think the compiler warning is incredibly unwise. A do .. while
(0) loop is the standard way of defining a macro that's safe to use like
a function. Surely the warning triggers on any robust macro code?

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Richard Pitts
2012-05-04 16:11:56 UTC
Permalink
Hi
I'm afraid it can't be in the 4.1.7 release. The cdrStream layout is quite different in trunk (which will be the 4.2.x release) to what's in 4.1.x. The 4.2.x version can't be back-ported to 4.1.x because it's binary incompatible. 4.1.x uses the CdrMarshal and CdrUnmarshal macros rather more.
Thanks that would be great. Good to know a 4.2.x release is on the way, we'll be upgrading when it's available.
Anyway, I think the compiler warning is incredibly unwise. A do .. while
(0) loop is the standard way of defining a macro that's safe to use like a function. Surely the warning triggers on any robust macro code?
Unfortunately one of Visual Studio's 'silly warnings', but surprisingly only triggered in cdrStream.h in our source. In C++ an inline function maybe preferable in some circumstances and I think this warning is there to discourage function-like macros.

Kind Regards

Richard Pitts
Windows Developer
CDL


-----Original Message-----
From: Duncan Grisby [mailto:***@grisby.org]
Sent: 04 May 2012 10:44
To: Richard Pitts
Cc: omniorb-***@omniorb-support.com
Subject: RE: [omniORB] Visual Studio 2008 level 4 compiler warnings
I?ve created a patch for cdrStream.h on trunk to resolve the C4127
warnings. The patch removes the CdrMarshal and CdrUnMarshal macros and
place the definitions in macro intMarshalFns.
Thanks for the patch. It makes sense for trunk, and I'll put something along those lines in. Perhaps you can send it again as an attachment, because it has become a bit mangled in the email body?
Any suggestions welcome and feel free to make any changes. I?m hoping
this can be in the 4.1.7 release.
I'm afraid it can't be in the 4.1.7 release. The cdrStream layout is quite different in trunk (which will be the 4.2.x release) to what's in 4.1.x. The 4.2.x version can't be back-ported to 4.1.x because it's binary incompatible. 4.1.x uses the CdrMarshal and CdrUnmarshal macros rather more.

Anyway, I think the compiler warning is incredibly unwise. A do .. while
(0) loop is the standard way of defining a macro that's safe to use like a function. Surely the warning triggers on any robust macro code?

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --


**********************************************************************
Please consider the environment - do you really need to print this email?

This email is intended only for the person(s) named above and may contain private and confidential information. If it has come to you in error, please destroy and permanently delete any copy in your possession and contact us on +44 (0) 161 480 4420. The information in this email is copyright ? CDL Group Holdings Limited. We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before opening any attachment.

Cheshire Datasystems Limited uses software which automatically screens incoming emails for inappropriate content and attachments. If the software identifies such content or attachment, the email will be forwarded to our Technology Department for checking. You should be aware that any email which you send to Cheshire Datasystems Limited is subject to this procedure.

Cheshire Datasystems Limited, Strata House, Kings Reach Road, Stockport SK4 2HD
Registered in England and Wales with Company Number 3991057
VAT registration: 727 1188 33
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C4127-warning-patch.diff
Type: application/octet-stream
Size: 2791 bytes
Desc: C4127-warning-patch.diff
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20120504/a991f8be/C4127-warning-patch.obj
William Bauder
2012-05-04 18:41:36 UTC
Permalink
Any reason for the do..while? The braces alone should suffice.

-----Original Message-----
From: omniorb-list-***@omniorb-support.com [mailto:omniorb-list-***@omniorb-support.com] On Behalf Of Duncan Grisby
Sent: Friday, May 04, 2012 5:44 AM
To: Richard Pitts
Cc: omniorb-***@omniorb-support.com
Subject: RE: [omniORB] Visual Studio 2008 level 4 compiler warnings
I?ve created a patch for cdrStream.h on trunk to resolve the C4127
warnings. The patch removes the CdrMarshal and CdrUnMarshal macros and
place the definitions in macro intMarshalFns.
Thanks for the patch. It makes sense for trunk, and I'll put something along those lines in. Perhaps you can send it again as an attachment, because it has become a bit mangled in the email body?
Any suggestions welcome and feel free to make any changes. I?m hoping
this can be in the 4.1.7 release.
I'm afraid it can't be in the 4.1.7 release. The cdrStream layout is quite different in trunk (which will be the 4.2.x release) to what's in 4.1.x. The 4.2.x version can't be back-ported to 4.1.x because it's binary incompatible. 4.1.x uses the CdrMarshal and CdrUnmarshal macros rather more.

Anyway, I think the compiler warning is incredibly unwise. A do .. while
(0) loop is the standard way of defining a macro that's safe to use like a function. Surely the warning triggers on any robust macro code?

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Duncan Grisby
2012-05-04 18:50:38 UTC
Permalink
Post by William Bauder
Any reason for the do..while? The braces alone should suffice.
The do..while is essential to avoid errors if a macro is used in an
if..else. See http://c-faq.com/cpp/multistmt.html for example.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...