Bug 1156 - opt build ‘result’ set but not used, g++4.6.0
authorJohn Abraham<john.abraham@gatech.edu>
Sat, 14 May 2011 04:32:10 -0400
changeset 7224 b4bc468ce2b5
parent 7223 9c5cdd710ea2
child 7225 3b4d401c4a5b
Bug 1156 - opt build ‘result’ set but not used, g++4.6.0
src/internet/helper/internet-stack-helper.cc
--- a/src/internet/helper/internet-stack-helper.cc	Sat May 14 04:29:31 2011 -0400
+++ b/src/internet/helper/internet-stack-helper.cc	Sat May 14 04:32:10 2011 -0400
@@ -492,6 +492,9 @@
       result = ipv4L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv4L3ProtocolRxTxSink));
       NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv4Internal():  "
                      "Unable to connect ipv4L3Protocol \"Rx\"");
+      // cast result to void, to suppress ‘result’ set but not used compiler-warning
+      // for optimized builds
+      (void) result;
     }
 
   g_interfaceFileMapIpv4[std::make_pair (ipv4, interface)] = file;
@@ -584,6 +587,9 @@
       result = ipv6L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv6L3ProtocolRxTxSink));
       NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv6Internal():  "
                      "Unable to connect ipv6L3Protocol \"Rx\"");
+      // cast found to void, to suppress ‘result’ set but not used compiler-warning
+      // for optimized builds
+      (void) result;
     }
 
   g_interfaceFileMapIpv6[std::make_pair (ipv6, interface)] = file;