[ 
https://issues.apache.org/activemq/browse/AMQCPP-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37895
 ] 

Albert Strasheim commented on AMQCPP-25:
----------------------------------------

We might consider using -Wstrict-aliasing=2. Warns in more cases, with some 
chance of false positives.

I still get the following warnings with GCC 4.1.1 on FC6 with revision 495335:

{noformat}
activemq/network/ServerSocket.cpp: In member function 'virtual void 
activemq::network::ServerSocket::bind(const char*, int, int)':
activemq/network/ServerSocket.cpp:162: warning: dereferencing type-punned 
pointer might break strict-aliasing rules
activemq/network/ServerSocket.cpp: In member function 'virtual 
activemq::network::Socket* activemq::network::ServerSocket::accept()':
activemq/network/ServerSocket.cpp:208: warning: dereferencing type-punned 
pointer might break strict-aliasing rules
activemq/io/DataInputStreamTest.h:85: warning: dereferencing type-punned 
pointer will break strict-aliasing rules
activemq/io/DataInputStreamTest.h:86: warning: dereferencing type-punned 
pointer will break strict-aliasing rules
{noformat}

I noticed you used a memcpys to fix this issue. Did you consider trying a 
union? Without knowing for certain (maybe we'll do some benchmarks tomorrow), a 
union might be faster than a call to memcpy.

Anyway, tests pass on FC6. Thanks very much.

> Bus error on Solaris OS from DataInput and DataOutput streams
> -------------------------------------------------------------
>
>                 Key: AMQCPP-25
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-25
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: CMS Impl
>    Affects Versions: 1.1
>         Environment: Solaris 10 OS
>            Reporter: Timothy Bish
>         Assigned To: Timothy Bish
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: optobug.cpp
>
>
> Due to misaligned memory reads, there is a bus error that can occur in using 
> the new DataInputStream and DataOutputStream classes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to