View | Details | Raw Unified | Return to bug 1170
Collapse All | Expand All

(-)a/examples/energy/energy-model-example.cc (-3 / +4 lines)
 Lines 43-48    Link Here 
43
void
43
void
44
ReceivePacket (Ptr<Socket> socket)
44
ReceivePacket (Ptr<Socket> socket)
45
{
45
{
46
#ifdef NS3_LOG_ENABLE
46
  Ptr<Packet> packet;
47
  Ptr<Packet> packet;
47
  Address from;
48
  Address from;
48
  while (packet = socket->RecvFrom (from))
49
  while (packet = socket->RecvFrom (from))
 Lines 53-63    Link Here 
53
          NS_LOG_UNCOND ("--\nReceived one packet! Socket: "<< iaddr.GetIpv4 ()
54
          NS_LOG_UNCOND ("--\nReceived one packet! Socket: "<< iaddr.GetIpv4 ()
54
                                                            << " port: " << iaddr.GetPort () << " at time = " <<
55
                                                            << " port: " << iaddr.GetPort () << " at time = " <<
55
                         Simulator::Now ().GetSeconds () << "\n--");
56
                         Simulator::Now ().GetSeconds () << "\n--");
56
          //cast iaddr to void, to suppress 'iaddr' set but not used compiler warning
57
          //in optimized builds
58
          (void) iaddr;
59
        }
57
        }
60
    }
58
    }
59
#else
60
  while (socket->Recv ());
61
#endif
61
}
62
}
62
63
63
/**
64
/**
(-)a/examples/wireless/multirate.cc (-11 / +4 lines)
 Lines 313-345    Link Here 
313
Experiment::ApplicationSetup (Ptr<Node> client, Ptr<Node> server, double start, double stop)
313
Experiment::ApplicationSetup (Ptr<Node> client, Ptr<Node> server, double start, double stop)
314
{
314
{
315
315
316
  Vector serverPos = GetPosition (server);
316
  NS_LOG_ONLY_ASSIGNMENT (Vector serverPos, GetPosition (server));
317
  Vector clientPos = GetPosition (client);
317
  NS_LOG_ONLY_ASSIGNMENT (Vector clientPos, GetPosition (client));
318
318
319
  Ptr<Ipv4> ipv4Server = server->GetObject<Ipv4>();
319
  Ptr<Ipv4> ipv4Server = server->GetObject<Ipv4>();
320
  Ptr<Ipv4> ipv4Client = client->GetObject<Ipv4>();
320
  Ptr<Ipv4> ipv4Client = client->GetObject<Ipv4>();
321
321
322
  Ipv4InterfaceAddress iaddrServer = ipv4Server->GetAddress (1,0);
322
  Ipv4InterfaceAddress iaddrServer = ipv4Server->GetAddress (1,0);
323
  Ipv4InterfaceAddress iaddrClient = ipv4Client->GetAddress (1,0);
323
  NS_LOG_ONLY_ASSIGNMENT (Ipv4InterfaceAddress iaddrClient, ipv4Client->GetAddress (1,0));
324
324
325
  Ipv4Address ipv4AddrServer = iaddrServer.GetLocal ();
325
  Ipv4Address ipv4AddrServer = iaddrServer.GetLocal ();
326
  Ipv4Address ipv4AddrClient = iaddrClient.GetLocal ();
326
  NS_LOG_ONLY_ASSIGNMENT (Ipv4Address ipv4AddrClient, iaddrClient.GetLocal ());
327
327
328
  NS_LOG_DEBUG ("Set up Server Device " <<  (server->GetDevice (0))->GetAddress ()
328
  NS_LOG_DEBUG ("Set up Server Device " <<  (server->GetDevice (0))->GetAddress ()
329
                                        << " with ip " << ipv4AddrServer
329
                                        << " with ip " << ipv4AddrServer
330
                                        << " position (" << serverPos.x << "," << serverPos.y << "," << serverPos.z << ")");
330
                                        << " position (" << serverPos.x << "," << serverPos.y << "," << serverPos.z << ")");
331
332
  NS_LOG_DEBUG ("Set up Client Device " <<  (client->GetDevice (0))->GetAddress ()
331
  NS_LOG_DEBUG ("Set up Client Device " <<  (client->GetDevice (0))->GetAddress ()
333
                                        << " with ip " << ipv4AddrClient
332
                                        << " with ip " << ipv4AddrClient
334
                                        << " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")"
333
                                        << " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")"
335
                                        << "\n");
334
                                        << "\n");
336
335
337
  //cast serverPos,clientPos,iaddrClient to void, to suppress variable set but not
338
  //used compiler warning in optimized builds
339
  (void) serverPos;
340
  (void) clientPos;
341
  (void) ipv4AddrClient;
342
343
  // Equipping the source  node with OnOff Application used for sending 
336
  // Equipping the source  node with OnOff Application used for sending 
344
  OnOffHelper onoff ("ns3::UdpSocketFactory", Address (InetSocketAddress (Ipv4Address ("10.0.0.1"), port)));
337
  OnOffHelper onoff ("ns3::UdpSocketFactory", Address (InetSocketAddress (Ipv4Address ("10.0.0.1"), port)));
345
  onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
338
  onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
(-)a/examples/wireless/wifi-simple-interference.cc (-3 / +2 lines)
 Lines 98-110    Link Here 
98
98
99
void ReceivePacket (Ptr<Socket> socket)
99
void ReceivePacket (Ptr<Socket> socket)
100
{
100
{
101
#ifdef NS3_LOG_ENABLE
101
  Address addr;
102
  Address addr;
102
  socket->GetSockName (addr);
103
  socket->GetSockName (addr);
103
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
104
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
104
  NS_LOG_UNCOND ("Received one packet!  Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ());
105
  NS_LOG_UNCOND ("Received one packet!  Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ());
105
  //cast iaddr to void, to suppress iaddr set but not used compiler warning
106
#endif
106
  //in optimized builds
107
  (void) iaddr;
108
}
107
}
109
108
110
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, 
109
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, 
(-)a/src/applications/model/packet-sink.cc (-4 / +1 lines)
 Lines 165-177    Link Here 
165
      if (InetSocketAddress::IsMatchingType (from))
165
      if (InetSocketAddress::IsMatchingType (from))
166
        {
166
        {
167
          m_totalRx += packet->GetSize ();
167
          m_totalRx += packet->GetSize ();
168
          InetSocketAddress address = InetSocketAddress::ConvertFrom (from);
168
          NS_LOG_ONLY_ASSIGNMENT (InetSocketAddress address, InetSocketAddress::ConvertFrom (from));
169
          NS_LOG_INFO ("Received " << packet->GetSize () << " bytes from " <<
169
          NS_LOG_INFO ("Received " << packet->GetSize () << " bytes from " <<
170
                       address.GetIpv4 () << " [" << address << "]"
170
                       address.GetIpv4 () << " [" << address << "]"
171
                                   << " total Rx " << m_totalRx);
171
                                   << " total Rx " << m_totalRx);
172
          //cast address to void , to suppress 'address' set but not used 
173
          //compiler warning in optimized builds
174
          (void) address;
175
        }
172
        }
176
      m_rxTrace (packet, from);
173
      m_rxTrace (packet, from);
177
    }
174
    }
(-)a/src/applications/model/v4ping.cc (-6 / +2 lines)
 Lines 235-249    Link Here 
235
  m_socket->SetAttribute ("Protocol", UintegerValue (1)); // icmp
235
  m_socket->SetAttribute ("Protocol", UintegerValue (1)); // icmp
236
  m_socket->SetRecvCallback (MakeCallback (&V4Ping::Receive, this));
236
  m_socket->SetRecvCallback (MakeCallback (&V4Ping::Receive, this));
237
  InetSocketAddress src = InetSocketAddress (Ipv4Address::GetAny (), 0);
237
  InetSocketAddress src = InetSocketAddress (Ipv4Address::GetAny (), 0);
238
  int status;
238
  NS_ASSERT_ASSIGNMENT (int status, m_socket->Bind (src));
239
  status = m_socket->Bind (src);
240
  NS_ASSERT (status != -1);
239
  NS_ASSERT (status != -1);
241
  InetSocketAddress dst = InetSocketAddress (m_remote, 0);
240
  InetSocketAddress dst = InetSocketAddress (m_remote, 0);
242
  status = m_socket->Connect (dst);
241
  NS_ASSERT_ASSIGNMENT (status, m_socket->Connect (dst));
243
  NS_ASSERT (status != -1);
242
  NS_ASSERT (status != -1);
244
  //cast status to void, to suppress 'status' set but not used compiler warning
245
  //in optimized builds
246
  (void) status;
247
243
248
  Send ();
244
  Send ();
249
}
245
}
(-)a/src/click/helper/click-internet-stack-helper.cc (-3 / +3 lines)
 Lines 449-457    Link Here 
449
          // be aggregated to the same node.
449
          // be aggregated to the same node.
450
          //
450
          //
451
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
451
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
452
          bool __attribute__ ((unused)) result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop",
452
          NS_ASSERT_ASSIGNMENT (bool result, ipv4L3Protocol->TraceConnectWithoutContext ("Drop",
453
                                                                                             MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext,
453
                                                                                         MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext,
454
                                                                                                                theStream));
454
                                                                                                            theStream)));
455
          NS_ASSERT_MSG (result == true, "ClickInternetStackHelper::EanableAsciiIpv4Internal():  "
455
          NS_ASSERT_MSG (result == true, "ClickInternetStackHelper::EanableAsciiIpv4Internal():  "
456
                         "Unable to connect ipv4L3Protocol \"Drop\"");
456
                         "Unable to connect ipv4L3Protocol \"Drop\"");
457
        }
457
        }
(-)a/src/core/examples/main-callback.cc (-10 / +7 lines)
 Lines 32-42    Link Here 
32
  // this is not a null callback
32
  // this is not a null callback
33
  NS_ASSERT (!one.IsNull ());
33
  NS_ASSERT (!one.IsNull ());
34
  // invoke cbOne function through callback instance
34
  // invoke cbOne function through callback instance
35
  double retOne;
35
  NS_ASSERT_ASSIGNMENT (double retOne, one (10.0, 20.0));
36
  retOne = one (10.0, 20.0);
36
  // callback returned expected value
37
  // cast retOne to void, to suppress variable ‘retOne’ set but
37
  NS_ASSERT (retOne == 10.0);
38
  // not used compiler warning
39
  (void) retOne; 
40
38
41
  // return type: int
39
  // return type: int
42
  // first arg type: double
40
  // first arg type: double
 Lines 47-57    Link Here 
47
  // this is not a null callback
45
  // this is not a null callback
48
  NS_ASSERT (!two.IsNull ());
46
  NS_ASSERT (!two.IsNull ());
49
  // invoke MyCb::cbTwo through callback instance
47
  // invoke MyCb::cbTwo through callback instance
50
  int retTwo;
48
  NS_ASSERT_ASSIGNMENT (int retTwo, two (10.0));
51
  retTwo = two (10.0);
49
  // callback returned expected value
52
  // cast retTwo to void, to suppress variable ‘retTwo’ set but
50
  NS_ASSERT (retTwo == -5);
53
  // not used compiler warning
51
54
  (void) retTwo;
55
  two = MakeNullCallback<int, double> ();
52
  two = MakeNullCallback<int, double> ();
56
  // invoking a null callback is just like
53
  // invoking a null callback is just like
57
  // invoking a null function pointer:
54
  // invoking a null function pointer:
(-)a/src/core/model/assert.h (+24 lines)
 Lines 95-104    Link Here 
95
    }                                                 \
95
    }                                                 \
96
  while (false)
96
  while (false)
97
97
98
/**
99
 * \ingroup assert
100
 * \param var the variable to assign to
101
 * \param value the value which to assign
102
 *
103
 * Construct a simple assignment (var = value) if NS3_ASSERT_ENABLE is true (debugging builds).
104
 * Expands to (value) otherwise.
105
 * This is useful to avoid "set but not used" compiler warnings in non-debugging builds.
106
 */
107
#define NS_ASSERT_ASSIGNMENT(var, value)      \
108
  var = (value)
109
110
/**
111
 * \ingroup assert
112
 * \param var the variable to assign to
113
 * \param value the value which to assign
114
 *
115
 * Similar to NS_ASSERT_ASSIGNMENT() but expands to absolutely nothing in non-debugging builds.
116
 */
117
#define NS_ASSERT_ONLY_ASSIGNMENT(var, value) \
118
  NS_ASSERT_ASSIGNMENT (var, value)
119
98
#else /* NS3_ASSERT_ENABLE */
120
#else /* NS3_ASSERT_ENABLE */
99
121
100
#define NS_ASSERT(cond)
122
#define NS_ASSERT(cond)
101
#define NS_ASSERT_MSG(cond,msg)
123
#define NS_ASSERT_MSG(cond,msg)
124
#define NS_ASSERT_ASSIGNMENT(var, value) (value)
125
#define NS_ASSERT_ONLY_ASSIGNMENT(var, value)
102
126
103
#endif /* NS3_ASSERT_ENABLE */
127
#endif /* NS3_ASSERT_ENABLE */
104
128
(-)a/src/core/model/log.h (+24 lines)
 Lines 323-328    Link Here 
323
    }                                   \
323
    }                                   \
324
  while (false)
324
  while (false)
325
325
326
/**
327
 * \ingroup logging
328
 * \param var the variable to assign to
329
 * \param value the value which to assign
330
 *
331
 * Construct a simple assignment if NS3_LOG_ENABLE is true (debugging builds).
332
 * Expands to (value) otherwise.
333
 * This is useful to avoid "set but not used" compiler warnings in non-debugging builds.
334
 */
335
#define NS_LOG_ASSIGNMENT(var, value)      \
336
  var = (value)
337
338
/**
339
 * \ingroup logging
340
 * \param var the variable to assign to
341
 * \param value the value which to assign
342
 *
343
 * Similar to NS_LOG_ASSIGNMENT() but expands to absolutely nothing in non-debugging builds.
344
 */
345
#define NS_LOG_ONLY_ASSIGNMENT(var, value) \
346
  NS_LOG_ASSIGNMENT (var, value)
347
326
#else /* LOG_ENABLE */
348
#else /* LOG_ENABLE */
327
349
328
#define NS_LOG_COMPONENT_DEFINE(component)
350
#define NS_LOG_COMPONENT_DEFINE(component)
 Lines 335-340    Link Here 
335
#define NS_LOG_FUNCTION(msg)
357
#define NS_LOG_FUNCTION(msg)
336
#define NS_LOG_LOGIC(msg)
358
#define NS_LOG_LOGIC(msg)
337
#define NS_LOG_UNCOND(msg)
359
#define NS_LOG_UNCOND(msg)
360
#define NS_LOG_ASSIGNMENT(var, value) (value)
361
#define NS_LOG_ONLY_ASSIGNMENT(var, value)
338
362
339
#endif /* LOG_ENABLE */
363
#endif /* LOG_ENABLE */
340
364
(-)a/src/core/model/unused.h (+8 lines)
Line 0    Link Here 
1
#ifndef UNUSED_H
2
#define UNUSED_H
3
4
#ifndef NS_UNUSED
5
# define NS_UNUSED(x) (void)(x)
6
#endif
7
8
#endif /* UNUSED_H */
(-)a/src/core/wscript (+1 lines)
 Lines 238-243    Link Here 
238
        'model/vector.h',
238
        'model/vector.h',
239
        'model/default-deleter.h',
239
        'model/default-deleter.h',
240
        'model/fatal-impl.h',
240
        'model/fatal-impl.h',
241
        'model/unused.h',
241
        ]
242
        ]
242
243
243
    if sys.platform == 'win32':
244
    if sys.platform == 'win32':
(-)a/src/flow-monitor/model/ipv4-flow-probe.cc (-5 / +2 lines)
 Lines 328-339    Link Here 
328
  Ipv4FlowProbeTag fTag;
328
  Ipv4FlowProbeTag fTag;
329
329
330
  // ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904
330
  // ConstCast: see http://www.nsnam.org/bugzilla/show_bug.cgi?id=904
331
  bool tagFound;
331
  NS_ASSERT_ASSIGNMENT (bool tagFound, ConstCast<Packet> (ipPayload)->RemovePacketTag (fTag));
332
  tagFound = ConstCast<Packet> (ipPayload)->RemovePacketTag (fTag);
333
  NS_ASSERT_MSG (tagFound, "FlowProbeTag is missing");
332
  NS_ASSERT_MSG (tagFound, "FlowProbeTag is missing");
334
  // cast tagFound to void, to suppress 'tagFound' set but not used compiler 
333
335
  // warning in optimized builds
336
  (void) tagFound;
337
  FlowId flowId = fTag.GetFlowId ();
334
  FlowId flowId = fTag.GetFlowId ();
338
  FlowPacketId packetId = fTag.GetPacketId ();
335
  FlowPacketId packetId = fTag.GetPacketId ();
339
  uint32_t size = fTag.GetPacketSize ();
336
  uint32_t size = fTag.GetPacketSize ();
(-)a/src/internet/helper/internet-stack-helper.cc (-14 / +8 lines)
 Lines 485-500    Link Here 
485
      NS_ASSERT_MSG (ipv4L3Protocol, "InternetStackHelper::EnablePcapIpv4Internal(): "
485
      NS_ASSERT_MSG (ipv4L3Protocol, "InternetStackHelper::EnablePcapIpv4Internal(): "
486
                     "m_ipv4Enabled and ipv4L3Protocol inconsistent");
486
                     "m_ipv4Enabled and ipv4L3Protocol inconsistent");
487
487
488
      bool result = ipv4L3Protocol->TraceConnectWithoutContext ("Tx", MakeCallback (&Ipv4L3ProtocolRxTxSink));
488
      NS_ASSERT_ASSIGNMENT (bool result, ipv4L3Protocol->TraceConnectWithoutContext ("Tx", MakeCallback (&Ipv4L3ProtocolRxTxSink)));
489
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv4Internal():  "
489
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv4Internal():  "
490
                     "Unable to connect ipv4L3Protocol \"Tx\"");
490
                     "Unable to connect ipv4L3Protocol \"Tx\"");
491
491
492
      result = ipv4L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv4L3ProtocolRxTxSink));
492
      NS_ASSERT_ASSIGNMENT (result, ipv4L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv4L3ProtocolRxTxSink)));
493
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv4Internal():  "
493
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv4Internal():  "
494
                     "Unable to connect ipv4L3Protocol \"Rx\"");
494
                     "Unable to connect ipv4L3Protocol \"Rx\"");
495
      // cast result to void, to suppress ‘result’ set but not used compiler-warning
496
      // for optimized builds
497
      (void) result;
498
    }
495
    }
499
496
500
  g_interfaceFileMapIpv4[std::make_pair (ipv4, interface)] = file;
497
  g_interfaceFileMapIpv4[std::make_pair (ipv4, interface)] = file;
 Lines 580-595    Link Here 
580
      NS_ASSERT_MSG (ipv6L3Protocol, "InternetStackHelper::EnablePcapIpv6Internal(): "
577
      NS_ASSERT_MSG (ipv6L3Protocol, "InternetStackHelper::EnablePcapIpv6Internal(): "
581
                     "m_ipv6Enabled and ipv6L3Protocol inconsistent");
578
                     "m_ipv6Enabled and ipv6L3Protocol inconsistent");
582
579
583
      bool result = ipv6L3Protocol->TraceConnectWithoutContext ("Tx", MakeCallback (&Ipv6L3ProtocolRxTxSink));
580
      NS_ASSERT_ASSIGNMENT (bool result, ipv6L3Protocol->TraceConnectWithoutContext ("Tx", MakeCallback (&Ipv6L3ProtocolRxTxSink)));
584
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv6Internal():  "
581
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv6Internal():  "
585
                     "Unable to connect ipv6L3Protocol \"Tx\"");
582
                     "Unable to connect ipv6L3Protocol \"Tx\"");
586
583
587
      result = ipv6L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv6L3ProtocolRxTxSink));
584
      NS_ASSERT_ASSIGNMENT (result, ipv6L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv6L3ProtocolRxTxSink)));
588
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv6Internal():  "
585
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv6Internal():  "
589
                     "Unable to connect ipv6L3Protocol \"Rx\"");
586
                     "Unable to connect ipv6L3Protocol \"Rx\"");
590
      // cast found to void, to suppress ‘result’ set but not used compiler-warning
591
      // for optimized builds
592
      (void) result;
593
    }
587
    }
594
588
595
  g_interfaceFileMapIpv6[std::make_pair (ipv6, interface)] = file;
589
  g_interfaceFileMapIpv6[std::make_pair (ipv6, interface)] = file;
 Lines 742-749    Link Here 
742
          // be aggregated to the same node.
736
          // be aggregated to the same node.
743
          //
737
          //
744
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
738
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
745
          bool __attribute__ ((unused)) result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop", 
739
          NS_ASSERT_ASSIGNMENT (bool result, ipv4L3Protocol->TraceConnectWithoutContext ("Drop", 
746
                                                                                             MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext, theStream));
740
                                                                                         MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext, theStream)));
747
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EanableAsciiIpv4Internal():  "
741
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EanableAsciiIpv4Internal():  "
748
                         "Unable to connect ipv4L3Protocol \"Drop\"");
742
                         "Unable to connect ipv4L3Protocol \"Drop\"");
749
        }
743
        }
 Lines 929-936    Link Here 
929
          // be aggregated to the same node.
923
          // be aggregated to the same node.
930
          //
924
          //
931
          Ptr<Ipv6L3Protocol> ipv6L3Protocol = ipv6->GetObject<Ipv6L3Protocol> ();
925
          Ptr<Ipv6L3Protocol> ipv6L3Protocol = ipv6->GetObject<Ipv6L3Protocol> ();
932
          bool __attribute__ ((unused)) result = ipv6L3Protocol->TraceConnectWithoutContext ("Drop", 
926
          NS_ASSERT_ASSIGNMENT (bool result, ipv6L3Protocol->TraceConnectWithoutContext ("Drop", 
933
                                                                                             MakeBoundCallback (&Ipv6L3ProtocolDropSinkWithoutContext, theStream));
927
                                                                                         MakeBoundCallback (&Ipv6L3ProtocolDropSinkWithoutContext, theStream)));
934
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EnableAsciiIpv6Internal():  "
928
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EnableAsciiIpv6Internal():  "
935
                         "Unable to connect ipv6L3Protocol \"Drop\"");
929
                         "Unable to connect ipv6L3Protocol \"Drop\"");
936
        }
930
        }
(-)a/src/internet/model/tcp-socket-base.cc (-5 / +1 lines)
 Lines 413-424    Link Here 
413
  if (packet != 0 && packet->GetSize () != 0)
413
  if (packet != 0 && packet->GetSize () != 0)
414
    {
414
    {
415
      SocketAddressTag tag;
415
      SocketAddressTag tag;
416
      bool found;
416
      NS_ASSERT_ASSIGNMENT (bool found, packet->PeekPacketTag (tag));
417
      found = packet->PeekPacketTag (tag);
418
      NS_ASSERT (found);
417
      NS_ASSERT (found);
419
      //cast found to void , to suppress 'found' set but not used compiler warning
420
      //in optimized builds
421
      (void) found;
422
      fromAddress = tag.GetAddress ();
418
      fromAddress = tag.GetAddress ();
423
    }
419
    }
424
  return packet;
420
  return packet;
(-)a/src/internet/model/udp-socket-impl.cc (-5 / +1 lines)
 Lines 544-555    Link Here 
544
  if (packet != 0)
544
  if (packet != 0)
545
    {
545
    {
546
      SocketAddressTag tag;
546
      SocketAddressTag tag;
547
      bool found;
547
      NS_ASSERT_ASSIGNMENT (bool found, packet->PeekPacketTag (tag));
548
      found = packet->PeekPacketTag (tag);
549
      NS_ASSERT (found);
548
      NS_ASSERT (found);
550
      //cast found to void, to suppress 'found' set but not used,compiler warning
551
      //in optimized builds
552
      (void) found;
553
      fromAddress = tag.GetAddress ();
549
      fromAddress = tag.GetAddress ();
554
    }
550
    }
555
  return packet;
551
  return packet;
(-)a/src/internet/test/ipv4-raw-test.cc (-10 / +2 lines)
 Lines 106-133    Link Here 
106
106
107
void Ipv4RawSocketImplTest::ReceivePkt (Ptr<Socket> socket)
107
void Ipv4RawSocketImplTest::ReceivePkt (Ptr<Socket> socket)
108
{
108
{
109
  uint32_t availableData;
109
  NS_ASSERT_ONLY_ASSIGNMENT (uint32_t availableData, socket->GetRxAvailable ());
110
  availableData = socket->GetRxAvailable ();
111
  m_receivedPacket = socket->Recv (2, MSG_PEEK);
110
  m_receivedPacket = socket->Recv (2, MSG_PEEK);
112
  NS_ASSERT (m_receivedPacket->GetSize () == 2);
111
  NS_ASSERT (m_receivedPacket->GetSize () == 2);
113
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
112
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
114
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
113
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
115
  //cast availableData to void, to suppress 'availableData' set but not used
116
  //compiler warning
117
  (void) availableData;
118
}
114
}
119
115
120
void Ipv4RawSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
116
void Ipv4RawSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
121
{
117
{
122
  uint32_t availableData;
118
  NS_ASSERT_ONLY_ASSIGNMENT (uint32_t availableData, socket->GetRxAvailable ());
123
  availableData = socket->GetRxAvailable ();
124
  m_receivedPacket2 = socket->Recv (2, MSG_PEEK);
119
  m_receivedPacket2 = socket->Recv (2, MSG_PEEK);
125
  NS_ASSERT (m_receivedPacket2->GetSize () == 2);
120
  NS_ASSERT (m_receivedPacket2->GetSize () == 2);
126
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
121
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
127
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
122
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
128
  //cast availableData to void, to suppress 'availableData' set but not used
129
  //compiler warning
130
  (void) availableData;
131
}
123
}
132
124
133
void
125
void
(-)a/src/internet/test/udp-test.cc (-15 / +3 lines)
 Lines 90-102    Link Here 
90
90
91
void UdpSocketLoopbackTest::ReceivePkt (Ptr<Socket> socket)
91
void UdpSocketLoopbackTest::ReceivePkt (Ptr<Socket> socket)
92
{
92
{
93
  uint32_t availableData;
93
  NS_ASSERT_ONLY_ASSIGNMENT (uint32_t availableData, socket->GetRxAvailable ());
94
  availableData = socket->GetRxAvailable ();
95
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
94
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
96
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
95
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
97
  //cast availableData to void, to suppress 'availableData' set but not used
98
  //compiler warning
99
  (void) availableData;
100
}
96
}
101
97
102
void
98
void
 Lines 151-174    Link Here 
151
147
152
void UdpSocketImplTest::ReceivePkt (Ptr<Socket> socket)
148
void UdpSocketImplTest::ReceivePkt (Ptr<Socket> socket)
153
{
149
{
154
  uint32_t availableData;
150
  NS_ASSERT_ONLY_ASSIGNMENT (uint32_t availableData, socket->GetRxAvailable ());
155
  availableData = socket->GetRxAvailable ();
156
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
151
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
157
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
152
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
158
  //cast availableData to void, to suppress 'availableData' set but not used
159
  //compiler warning
160
  (void) availableData;
161
}
153
}
162
154
163
void UdpSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
155
void UdpSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
164
{
156
{
165
  uint32_t availableData;
157
  NS_ASSERT_ONLY_ASSIGNMENT (uint32_t availableData, socket->GetRxAvailable ());
166
  availableData = socket->GetRxAvailable ();
167
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
158
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max (), 0);
168
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
159
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
169
  //cast availableData to void, to suppress 'availableData' set but not used
170
  //compiler warning
171
  (void) availableData;
172
}
160
}
173
161
174
void
162
void
(-)a/src/mesh/model/dot11s/peer-management-protocol.cc (-5 / +1 lines)
 Lines 383-393    Link Here 
383
  UniformVariable beaconShift (-m_maxBeaconShift, m_maxBeaconShift);
383
  UniformVariable beaconShift (-m_maxBeaconShift, m_maxBeaconShift);
384
  PeerLinksMap::iterator iface = m_peerLinks.find (interface);
384
  PeerLinksMap::iterator iface = m_peerLinks.find (interface);
385
  NS_ASSERT (iface != m_peerLinks.end ());
385
  NS_ASSERT (iface != m_peerLinks.end ());
386
  PeerManagementProtocolMacMap::const_iterator plugin = m_plugins.find (interface);
386
  NS_ASSERT (m_plugins.find (interface) != m_plugins.end ());
387
  NS_ASSERT (plugin != m_plugins.end ());
388
  // cast plugin to void, to suppress 'plugin' set but not used, compiler warning
389
  // in optimized builds
390
  (void) plugin;
391
  std::map<uint32_t, Time>::const_iterator lastBeacon = m_lastBeacon.find (interface);
387
  std::map<uint32_t, Time>::const_iterator lastBeacon = m_lastBeacon.find (interface);
392
  std::map<uint32_t, Time>::const_iterator beaconInterval = m_beaconInterval.find (interface);
388
  std::map<uint32_t, Time>::const_iterator beaconInterval = m_beaconInterval.find (interface);
393
  if ((lastBeacon == m_lastBeacon.end ()) || (beaconInterval == m_beaconInterval.end ()))
389
  if ((lastBeacon == m_lastBeacon.end ()) || (beaconInterval == m_beaconInterval.end ()))
(-)a/src/mobility/helper/ns2-mobility-helper.cc (-2 / +2 lines)
 Lines 42-47    Link Here 
42
#include <sstream>
42
#include <sstream>
43
#include <map>
43
#include <map>
44
#include "ns3/log.h"
44
#include "ns3/log.h"
45
#include "ns3/unused.h"
45
#include "ns3/simulator.h"
46
#include "ns3/simulator.h"
46
#include "ns3/node-list.h"
47
#include "ns3/node-list.h"
47
#include "ns3/node.h"
48
#include "ns3/node.h"
 Lines 400-407    Link Here 
400
{
401
{
401
  char *endp;
402
  char *endp;
402
  double v = strtod (s.c_str (), &endp); // declared with warn_unused_result
403
  double v = strtod (s.c_str (), &endp); // declared with warn_unused_result
403
  //cast v to void, to suppress v set but not used compiler warning
404
  NS_UNUSED (v); // suppress "set but not used" compiler warning
404
  (void) v;
405
  return endp == s.c_str () + s.size ();
405
  return endp == s.c_str () + s.size ();
406
}
406
}
407
407
(-)a/src/network/helper/trace-helper.h (-18 / +31 lines)
 Lines 94-101    Link Here 
94
template <typename T> void
94
template <typename T> void
95
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileWrapper> file)
95
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileWrapper> file)
96
{
96
{
97
  bool __attribute__ ((unused)) result = 
97
  NS_ASSERT_ASSIGNMENT (bool result,
98
    object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file));
98
                        object->TraceConnectWithoutContext (tracename.c_str (),
99
                                                            MakeBoundCallback (&DefaultSink, file)));
99
  NS_ASSERT_MSG (result == true, "PcapHelper::HookDefaultSink():  Unable to hook \"" << tracename << "\"");
100
  NS_ASSERT_MSG (result == true, "PcapHelper::HookDefaultSink():  Unable to hook \"" << tracename << "\"");
100
}
101
}
101
102
 Lines 231-238    Link Here 
231
template <typename T> void
232
template <typename T> void
232
AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
233
AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
233
{
234
{
234
  bool __attribute__ ((unused)) result = 
235
  NS_ASSERT_ASSIGNMENT (bool result,
235
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultEnqueueSinkWithoutContext, file));
236
                        object->TraceConnectWithoutContext (tracename,
237
                                                            MakeBoundCallback (&DefaultEnqueueSinkWithoutContext, file)));
236
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext():  Unable to hook \"" 
238
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext():  Unable to hook \"" 
237
                 << tracename << "\"");
239
                 << tracename << "\"");
238
}
240
}
 Lines 244-251    Link Here 
244
  std::string tracename, 
246
  std::string tracename, 
245
  Ptr<OutputStreamWrapper> stream)
247
  Ptr<OutputStreamWrapper> stream)
246
{
248
{
247
  bool __attribute__ ((unused)) result = 
249
  NS_ASSERT_ASSIGNMENT (bool result,
248
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream));
250
                        object->TraceConnect (tracename,
251
                                              context,
252
                                              MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream)));
249
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithContext():  Unable to hook \"" 
253
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithContext():  Unable to hook \"" 
250
                 << tracename << "\"");
254
                 << tracename << "\"");
251
}
255
}
 Lines 253-260    Link Here 
253
template <typename T> void
257
template <typename T> void
254
AsciiTraceHelper::HookDefaultDropSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
258
AsciiTraceHelper::HookDefaultDropSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
255
{
259
{
256
  bool __attribute__ ((unused)) result = 
260
  NS_ASSERT_ASSIGNMENT (bool result,
257
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDropSinkWithoutContext, file));
261
                        object->TraceConnectWithoutContext (tracename,
262
                                                            MakeBoundCallback (&DefaultDropSinkWithoutContext, file)));
258
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithoutContext():  Unable to hook \"" 
263
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithoutContext():  Unable to hook \"" 
259
                 << tracename << "\"");
264
                 << tracename << "\"");
260
}
265
}
 Lines 266-273    Link Here 
266
  std::string tracename, 
271
  std::string tracename, 
267
  Ptr<OutputStreamWrapper> stream)
272
  Ptr<OutputStreamWrapper> stream)
268
{
273
{
269
  bool __attribute__ ((unused)) result = 
274
  NS_ASSERT_ASSIGNMENT (bool result,
270
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDropSinkWithContext, stream));
275
                        object->TraceConnect (tracename,
276
                                              context,
277
                                              MakeBoundCallback (&DefaultDropSinkWithContext, stream)));
271
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithContext():  Unable to hook \"" 
278
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithContext():  Unable to hook \"" 
272
                 << tracename << "\"");
279
                 << tracename << "\"");
273
}
280
}
 Lines 275-282    Link Here 
275
template <typename T> void
282
template <typename T> void
276
AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
283
AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
277
{
284
{
278
  bool __attribute__ ((unused)) result = 
285
  NS_ASSERT_ASSIGNMENT (bool result,
279
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file));
286
                        object->TraceConnectWithoutContext (tracename,
287
                                                            MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file)));
280
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext():  Unable to hook \"" 
288
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext():  Unable to hook \"" 
281
                 << tracename << "\"");
289
                 << tracename << "\"");
282
}
290
}
 Lines 288-295    Link Here 
288
  std::string tracename, 
296
  std::string tracename, 
289
  Ptr<OutputStreamWrapper> stream)
297
  Ptr<OutputStreamWrapper> stream)
290
{
298
{
291
  bool __attribute__ ((unused)) result = 
299
  NS_ASSERT_ASSIGNMENT (bool result,
292
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDequeueSinkWithContext, stream));
300
                        object->TraceConnect (tracename,
301
                                              context,
302
                                              MakeBoundCallback (&DefaultDequeueSinkWithContext, stream)));
293
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithContext():  Unable to hook \"" 
303
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithContext():  Unable to hook \"" 
294
                 << tracename << "\"");
304
                 << tracename << "\"");
295
}
305
}
 Lines 297-304    Link Here 
297
template <typename T> void
307
template <typename T> void
298
AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
308
AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
299
{
309
{
300
  bool __attribute__ ((unused)) result = 
310
  NS_ASSERT_ASSIGNMENT (bool result,
301
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file));
311
                        object->TraceConnectWithoutContext (tracename,
312
                                                            MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file)));
302
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext():  Unable to hook \"" 
313
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext():  Unable to hook \"" 
303
                 << tracename << "\"");
314
                 << tracename << "\"");
304
}
315
}
 Lines 310-317    Link Here 
310
  std::string tracename, 
321
  std::string tracename, 
311
  Ptr<OutputStreamWrapper> stream)
322
  Ptr<OutputStreamWrapper> stream)
312
{
323
{
313
  bool __attribute__ ((unused)) result = 
324
  NS_ASSERT_ASSIGNMENT (bool result,
314
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultReceiveSinkWithContext, stream));
325
                        object->TraceConnect (tracename,
326
                                              context,
327
                                              MakeBoundCallback (&DefaultReceiveSinkWithContext, stream)));
315
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithContext():  Unable to hook \"" 
328
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithContext():  Unable to hook \"" 
316
                 << tracename << "\"");
329
                 << tracename << "\"");
317
}
330
}
(-)a/src/network/model/socket.cc (-5 / +2 lines)
 Lines 304-322    Link Here 
304
{
304
{
305
  if (netdevice != 0)
305
  if (netdevice != 0)
306
    {
306
    {
307
      bool found = false;
307
      NS_ASSERT_ONLY_ASSIGNMENT (bool found, false);
308
      for (uint32_t i = 0; i < GetNode ()->GetNDevices (); i++)
308
      for (uint32_t i = 0; i < GetNode ()->GetNDevices (); i++)
309
        {
309
        {
310
          if (GetNode ()->GetDevice (i) == netdevice)
310
          if (GetNode ()->GetDevice (i) == netdevice)
311
            {
311
            {
312
              found = true;
312
              NS_ASSERT_ONLY_ASSIGNMENT (found, true);
313
              break;
313
              break;
314
            }
314
            }
315
        }
315
        }
316
      NS_ASSERT_MSG (found, "Socket cannot be bound to a NetDevice not existing on the Node");
316
      NS_ASSERT_MSG (found, "Socket cannot be bound to a NetDevice not existing on the Node");
317
      //cast found to void, to suppress 'found' set but not used compiler warning
318
      //in optimized builds
319
      (void) found;
320
    }
317
    }
321
  m_boundnetdevice = netdevice;
318
  m_boundnetdevice = netdevice;
322
  return;
319
  return;
(-)a/src/network/utils/packet-socket.cc (-5 / +1 lines)
 Lines 438-449    Link Here 
438
  if (packet != 0)
438
  if (packet != 0)
439
    {
439
    {
440
      SocketAddressTag tag;
440
      SocketAddressTag tag;
441
      bool found;
441
      NS_ASSERT_ASSIGNMENT (bool found, packet->PeekPacketTag (tag));
442
      found = packet->PeekPacketTag (tag);
443
      NS_ASSERT (found);
442
      NS_ASSERT (found);
444
      //cast found to void, to suppress 'found' set but not used compiler warning
445
      //in optimized builds
446
      (void) found;
447
      fromAddress = tag.GetAddress ();
443
      fromAddress = tag.GetAddress ();
448
    }
444
    }
449
  return packet;
445
  return packet;
(-)a/src/network/utils/radiotap-header.cc (-2 / +5 lines)
 Lines 134-141    Link Here 
134
{
134
{
135
  NS_LOG_FUNCTION (this);
135
  NS_LOG_FUNCTION (this);
136
136
137
  uint8_t __attribute__ ((unused)) tmp = start.ReadU8 (); // major version of radiotap header
137
#ifdef NS3_ASSERT_ENABLE
138
  NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version");
138
  NS_ASSERT_MSG (start.ReadU8 () == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version"); // major version of radiotap header
139
#else
140
  start.Next (); // major version of radiotap header
141
#endif
139
  start.ReadU8 (); // pad field
142
  start.ReadU8 (); // pad field
140
143
141
  m_length = start.ReadU16 (); // entire length of radiotap data + header
144
  m_length = start.ReadU16 (); // entire length of radiotap data + header
(-)a/src/test/ns3wifi/wifi-interference-test-suite.cc (-3 / +2 lines)
 Lines 80-92    Link Here 
80
void 
80
void 
81
WifiInterferenceTestCase::ReceivePacket (Ptr<Socket> socket)
81
WifiInterferenceTestCase::ReceivePacket (Ptr<Socket> socket)
82
{
82
{
83
#ifdef NS3_LOG_ENABLE
83
  Address addr;
84
  Address addr;
84
  socket->GetSockName (addr);
85
  socket->GetSockName (addr);
85
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
86
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
86
  NS_LOG_UNCOND ("Received one packet!  Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ());
87
  NS_LOG_UNCOND ("Received one packet!  Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ());
87
  //cast iaddr to void, to suppress 'iaddr' set but not used compiler warning 
88
#endif
88
  //in optimized builds
89
  (void) iaddr;
90
}
89
}
91
90
92
void 
91
void 
(-)a/src/topology-read/model/rocketfuel-topology-reader.cc (-7 / +6 lines)
 Lines 25-30    Link Here 
25
#include <regex.h>
25
#include <regex.h>
26
26
27
#include "ns3/log.h"
27
#include "ns3/log.h"
28
#include "ns3/unused.h"
28
#include "rocketfuel-topology-reader.h"
29
#include "rocketfuel-topology-reader.h"
29
30
30
namespace ns3 {
31
namespace ns3 {
 Lines 84-91    Link Here 
84
  std::string ptr;
85
  std::string ptr;
85
  std::string name;
86
  std::string name;
86
  std::string nuid;
87
  std::string nuid;
88
#ifdef NS3_LOG_ENABLE
87
  bool dns = false;
89
  bool dns = false;
88
  bool bb = false;
90
  bool bb = false;
91
#endif
89
  int num_neigh_s = 0;
92
  int num_neigh_s = 0;
90
  unsigned int num_neigh = 0;
93
  unsigned int num_neigh = 0;
91
  int radius = 0;
94
  int radius = 0;
 Lines 95-100    Link Here 
95
  uid = argv[0];
98
  uid = argv[0];
96
  loc = argv[1];
99
  loc = argv[1];
97
100
101
#ifdef NS3_LOG_ENABLE
98
  if (argv[2])
102
  if (argv[2])
99
    {
103
    {
100
      dns = true;
104
      dns = true;
 Lines 104-109    Link Here 
104
    {
108
    {
105
      bb = true;
109
      bb = true;
106
    }
110
    }
111
#endif
107
112
108
  num_neigh_s = ::atoi (argv[4]);
113
  num_neigh_s = ::atoi (argv[4]);
109
  if (num_neigh_s < 0)
114
  if (num_neigh_s < 0)
 Lines 156-166    Link Here 
156
                            << "(" << "%d" << ") externals: \"%s\"(%d) "
161
                            << "(" << "%d" << ") externals: \"%s\"(%d) "
157
                            << "name: " << name << " radius: " << radius);
162
                            << "name: " << name << " radius: " << radius);
158
163
159
  //cast bb and dns to void, to suppress variable set but not used compiler warning
160
  //in optimized builds
161
  (void) bb;
162
  (void) dns;
163
164
  // Create node and link
164
  // Create node and link
165
  if (!uid.empty ())
165
  if (!uid.empty ())
166
    {
166
    {
 Lines 209-216    Link Here 
209
  sname = argv[0];
209
  sname = argv[0];
210
  tname = argv[1];
210
  tname = argv[1];
211
  double v = strtod (argv[2], &endptr); // weight
211
  double v = strtod (argv[2], &endptr); // weight
212
  // cast v to void , to suppress 'v' set but not used compiler warning
212
  NS_UNUSED (v); // suppress "set but not used" compiler warning in optimized builds
213
  (void) v;
214
  if (*endptr != '\0')
213
  if (*endptr != '\0')
215
    {
214
    {
216
      NS_LOG_WARN ("invalid weight: " << argv[2]);
215
      NS_LOG_WARN ("invalid weight: " << argv[2]);
(-)a/src/wifi/model/wifi-information-element.cc (-4 / +1 lines)
 Lines 50-63    Link Here 
50
Buffer::Iterator
50
Buffer::Iterator
51
WifiInformationElement::Deserialize (Buffer::Iterator i)
51
WifiInformationElement::Deserialize (Buffer::Iterator i)
52
{
52
{
53
  Buffer::Iterator start = i;
53
  NS_ASSERT_ONLY_ASSIGNMENT (Buffer::Iterator start, i);
54
  i = DeserializeIfPresent (i);
54
  i = DeserializeIfPresent (i);
55
  // This IE was not optional, so confirm that we did actually
55
  // This IE was not optional, so confirm that we did actually
56
  // deserialise something.
56
  // deserialise something.
57
  NS_ASSERT (i.GetDistanceFrom (start) != 0);
57
  NS_ASSERT (i.GetDistanceFrom (start) != 0);
58
  // cast start to void, to suppress ‘start’ set but not used
59
  // compiler warning in optimized builds
60
  (void) start;
61
  return i;
58
  return i;
62
}
59
}
63
60
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-10 / +2 lines)
 Lines 365-376    Link Here 
365
  if (!IsLowLatency ())
365
  if (!IsLowLatency ())
366
    {
366
    {
367
      TxModeTag tag;
367
      TxModeTag tag;
368
      bool found;
368
      NS_ASSERT_ASSIGNMENT (bool found, ConstCast<Packet> (packet)->PeekPacketTag (tag));
369
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
370
      NS_ASSERT (found);
369
      NS_ASSERT (found);
371
      // cast found to void, to suppress 'found' set but not used
372
      // compiler warning
373
      (void) found;
374
      return tag.GetDataMode ();
370
      return tag.GetDataMode ();
375
    }
371
    }
376
  return DoGetDataMode (Lookup (address, header), fullPacketSize);
372
  return DoGetDataMode (Lookup (address, header), fullPacketSize);
 Lines 383-394    Link Here 
383
  if (!IsLowLatency ())
379
  if (!IsLowLatency ())
384
    {
380
    {
385
      TxModeTag tag;
381
      TxModeTag tag;
386
      bool found;
382
      NS_ASSERT_ASSIGNMENT (bool found, ConstCast<Packet> (packet)->PeekPacketTag (tag));
387
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
388
      NS_ASSERT (found);
383
      NS_ASSERT (found);
389
      // cast found to void, to suppress 'found' set but not used
390
      // compiler warning
391
      (void) found;
392
      return tag.GetRtsMode ();
384
      return tag.GetRtsMode ();
393
    }
385
    }
394
  return DoGetRtsMode (Lookup (address, header));
386
  return DoGetRtsMode (Lookup (address, header));

Return to bug 1170