Get rid of the compiler warning about strict aliasing rule.
authorBjoern Sikora <bjoern.sikora@intra2net.com>
Fri, 18 Sep 2009 09:09:22 +0000 (11:09 +0200)
committerBjoern Sikora <bjoern.sikora@intra2net.com>
Fri, 18 Sep 2009 09:09:22 +0000 (11:09 +0200)
src/ip_addr_helper.cpp
src/service_easydns.cpp

index 0c7894c..44497ba 100644 (file)
@@ -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() )
index b94358a..75ce7ac 100644 (file)
@@ -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<string> domain_tokens;
     ba::split(domain_tokens,domain_part,boost::is_any_of("."));