qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl Trieloff <cctriel...@redhat.com>
Subject Re: Installing broker on Ubuntu - Strict aliasing problem
Date Mon, 16 Nov 2009 13:08:33 GMT

Is this 0.5 or trunk?

Carl.


Leticia wrote:
> Hello there!
>
> I have a problem doing the make all part of the installation process of qpid
> broker. It looks exactly  like this:
>
> qpid/sys/posix/SystemInfo.cpp: In function 'void qpid::sys::SystemInfo::
> getLocalIpAddresses(uint16_t, std::vector<qpid::Address,
> std::allocator<qpid::Address> >&)':
> qpid/sys/posix/SystemInfo.cpp:73: error: dereferencing pointer 'sin' does
> break strict-aliasing rules
> qpid/sys/posix/SystemInfo.cpp:72: note: initialized from here
>
> And the code lines correspond to these ones:
>
> void SystemInfo::getLocalIpAddresses (uint16_t port, std::vector<Address>
> &addrList) {
>     int s = socket (PF_INET, SOCK_STREAM, 0);
>     for (int i=1;;i++) {
>         struct ifreq ifr;
>         ifr.ifr_ifindex = i;
>         if (::ioctl (s, SIOCGIFNAME, &ifr) < 0)
>             break;
>         /* now ifr.ifr_name is set */
>         if (::ioctl (s, SIOCGIFADDR, &ifr) < 0)
>             continue;
>         struct sockaddr_in *sin = (struct sockaddr_in *) &ifr.ifr_addr;
> /*Line 72*/
>         string addr(inet_ntoa(sin->sin_addr)); /*Line 73 breaking rules! */
>         if (addr != LOCALHOST)
>             addrList.push_back(TcpAddress(addr, port));
>     }
>     if (addrList.empty()) {
>         addrList.push_back(TcpAddress(LOCALHOST, port));
>     }
>     close (s);
> }
>
>
> I'm using the latest Ubuntu version and gcc 4.4 and I'd like to solve this
> problem without going back to the previous version of the compiler.
>
> Could you please help me?
>
> Thanks a lot!
>
> Reytita
>
>   


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message