| Summary | This article clarifies an issue when using strict-aliasing with GCC optimization in Orbacus |
|---|---|
| Article Number | 34739 |
| Environment | ORBacus for C 4.3.4 Linux-SuSE 11 |
| Question/Problem Description | Orbacus issue in InputStreamImpl class, when using strict-aliasing with GCC optimization. The issue occurs in the method InputStreamImpl::read_double() and read_longdouble() when compiled under Linux on Intel machine with GCC 4.3.4. When a C servant communicates with a Java client double, longdouble and float values are not correct. |
| Clarifying Information | |
| Error Message | > g -c -I. -I../../include -I../../../jtc/include -DNDEBUG -g -O3 -fPIC -Wall -Wno-format-y2k Stream.cpp Stream.cpp: In member function 'CORBA::Double OB::InputStreamImpl::read_double()': Stream.cpp:1658: warning: dereferencing type-punned pointer will break strict-aliasing rules Stream.cpp:1666: warning: dereferencing type-punned pointer will break strict-aliasing rules Stream.cpp: In member function 'CORBA::LongDouble OB::InputStreamImpl::read_longdouble()': Stream.cpp:1706: warning: dereferencing type-punned pointer will break strict-aliasing rules Stream.cpp:1718: warning: dereferencing type-punned pointer will break strict-aliasing rules |
| Defect/Enhancement Number | OB-99 |
| Cause | This is because Java writes data in big-endian also on little-endian machine such as Intel. |
| Resolution | Please contact Micro Focus Support Line for a patch providing a fix for this issue. This issue has been fixed in Orbacus 4.3.4 patch 4.3.4.05. |
| Workaround | |
| Notes | |
| Attachment |
| Created date: | 12 September 2012 |
|---|---|
| Last Modified: | 12 February 2013 |
| Last Published: | 17 September 2012 |
| First Published date: | 17 September 2012 |
#Orbacus
#KnowledgeDocs