From: Bjoern Sikora Date: Fri, 18 Sep 2009 09:09:22 +0000 (+0200) Subject: Get rid of the compiler warning about strict aliasing rule. X-Git-Tag: v1.1~177 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=687d99fb52e01746acc694e31a82393db7fd423d;p=bpdyndnsd Get rid of the compiler warning about strict aliasing rule. --- diff --git a/src/ip_addr_helper.cpp b/src/ip_addr_helper.cpp index 0c7894c..44497ba 100644 --- a/src/ip_addr_helper.cpp +++ b/src/ip_addr_helper.cpp @@ -143,7 +143,7 @@ string IPAddrHelper::get_actual_ip() const /** - * Get the actual IP of this host through a DNS query. + * Get the actual IP of the given host through a DNS query. * @param _hostname The hostname for the dns lookup, if empty string, then perform a dns lookup to the local hostname. * @return A string representation of the actual IP in dotted format or an empty string if something went wrong. */ @@ -166,8 +166,8 @@ string IPAddrHelper::dns_query(const string& _hostname) const net::ip::tcp::resolver::iterator end; while(endpoint_iterator != end) { - net::ip::tcp::endpoint endpoint = endpoint_iterator->endpoint(); // this ends up in a compiler warning: cc1plus: warning: dereferencing pointer 'pretmp.37188' does break strict-aliasing rules - net::ip::address ip = endpoint.address(); // but why? + net::ip::address ip; + ip = endpoint_iterator->endpoint().address(); if ( ip.is_v4() ) ip_addr_v4 = ip.to_string(); else if ( ip.is_v6() ) diff --git a/src/service_easydns.cpp b/src/service_easydns.cpp index b94358a..75ce7ac 100644 --- a/src/service_easydns.cpp +++ b/src/service_easydns.cpp @@ -85,8 +85,6 @@ ServiceEasydns::~ServiceEasydns() */ string ServiceEasydns::get_two_level_tld(const string& domain_part) const { - // TODO: There is a list with all two level TLD's, use it - // split the domain_part list domain_tokens; ba::split(domain_tokens,domain_part,boost::is_any_of("."));