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

(-)a/examples/energy/energy-model-example.cc (-3 / +1 lines)
 Lines 53-61    Link Here 
53
          NS_LOG_UNCOND ("--\nReceived one packet! Socket: "<< iaddr.GetIpv4 ()
53
          NS_LOG_UNCOND ("--\nReceived one packet! Socket: "<< iaddr.GetIpv4 ()
54
                                                            << " port: " << iaddr.GetPort () << " at time = " <<
54
                                                            << " port: " << iaddr.GetPort () << " at time = " <<
55
                         Simulator::Now ().GetSeconds () << "\n--");
55
                         Simulator::Now ().GetSeconds () << "\n--");
56
          //cast iaddr to void, to suppress 'iaddr' set but not used compiler warning
56
          NS_UNUSED (iaddr); // suppress "set but not used" compiler warning in optimized builds
57
          //in optimized builds
58
          (void) iaddr;
59
        }
57
        }
60
    }
58
    }
61
}
59
}
(-)a/examples/wireless/multirate.cc (-6 / +3 lines)
 Lines 328-344    Link Here 
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
  NS_UNUSED (serverPos); // suppress "set but not used" compiler warning in optimized builds
331
332
332
  NS_LOG_DEBUG("Set up Client Device " <<  (client->GetDevice(0))->GetAddress () 
333
  NS_LOG_DEBUG("Set up Client Device " <<  (client->GetDevice(0))->GetAddress () 
333
                                       << " with ip " << ipv4AddrClient
334
                                       << " with ip " << ipv4AddrClient
334
                                       << " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")"
335
                                       << " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")"
335
                                       << "\n");
336
                                       << "\n");
336
337
  NS_UNUSED (ipv4AddrClient); // suppress "set but not used" compiler warning in optimized builds
337
  //cast serverPos,clientPos,iaddrClient to void, to suppress variable set but not
338
  NS_UNUSED (clientPos); // suppress "set but not used" compiler warning in optimized builds
338
  //used compiler warning in optimized builds
339
  (void) serverPos;
340
  (void) clientPos;
341
  (void) ipv4AddrClient;
342
339
343
  // Equipping the source  node with OnOff Application used for sending 
340
  // Equipping the source  node with OnOff Application used for sending 
344
  OnOffHelper onoff ("ns3::UdpSocketFactory", Address(InetSocketAddress(Ipv4Address("10.0.0.1"), port)));
341
  OnOffHelper onoff ("ns3::UdpSocketFactory", Address(InetSocketAddress(Ipv4Address("10.0.0.1"), port)));
(-)a/examples/wireless/wifi-simple-interference.cc (-3 / +1 lines)
 Lines 102-110    Link Here 
102
  socket->GetSockName (addr);
102
  socket->GetSockName (addr);
103
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
103
  InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
104
  NS_LOG_UNCOND ("Received one packet!  Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ());
104
  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
105
  NS_UNUSED (iaddr); // suppress "set but not used" compiler warning in optimized builds
106
  //in optimized builds
107
  (void) iaddr;
108
}
106
}
109
107
110
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, 
108
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, 
(-)a/src/applications/model/packet-sink.cc (-3 / +2 lines)
 Lines 20-25    Link Here 
20
#include "ns3/address.h"
20
#include "ns3/address.h"
21
#include "ns3/address-utils.h"
21
#include "ns3/address-utils.h"
22
#include "ns3/log.h"
22
#include "ns3/log.h"
23
#include "ns3/unused.h"
23
#include "ns3/inet-socket-address.h"
24
#include "ns3/inet-socket-address.h"
24
#include "ns3/node.h"
25
#include "ns3/node.h"
25
#include "ns3/socket.h"
26
#include "ns3/socket.h"
 Lines 169-177    Link Here 
169
          NS_LOG_INFO ("Received " << packet->GetSize() << " bytes from " << 
170
          NS_LOG_INFO ("Received " << packet->GetSize() << " bytes from " << 
170
                       address.GetIpv4() << " [" << address << "]" 
171
                       address.GetIpv4() << " [" << address << "]" 
171
                                   << " total Rx " << m_totalRx);
172
                                   << " total Rx " << m_totalRx);
172
          //cast address to void , to suppress 'address' set but not used 
173
          NS_UNUSED (address); // suppress "set but not used" compiler warning in optimized builds
173
          //compiler warning in optimized builds
174
          (void) address;
175
        }
174
        }
176
      m_rxTrace (packet, from);
175
      m_rxTrace (packet, from);
177
    }
176
    }
(-)a/src/applications/model/v4ping.cc (-3 / +2 lines)
 Lines 17-22    Link Here 
17
#include "ns3/icmpv4.h"
17
#include "ns3/icmpv4.h"
18
#include "ns3/assert.h"
18
#include "ns3/assert.h"
19
#include "ns3/log.h"
19
#include "ns3/log.h"
20
#include "ns3/unused.h"
20
#include "ns3/ipv4-address.h"
21
#include "ns3/ipv4-address.h"
21
#include "ns3/socket.h"
22
#include "ns3/socket.h"
22
#include "ns3/uinteger.h"
23
#include "ns3/uinteger.h"
 Lines 241-249    Link Here 
241
  InetSocketAddress dst = InetSocketAddress (m_remote, 0);
242
  InetSocketAddress dst = InetSocketAddress (m_remote, 0);
242
  status = m_socket->Connect (dst);
243
  status = m_socket->Connect (dst);
243
  NS_ASSERT (status != -1);
244
  NS_ASSERT (status != -1);
244
  //cast status to void, to suppress 'status' set but not used compiler warning
245
  NS_UNUSED (status); // suppress "set but not used" compiler warning in optimized builds
245
  //in optimized builds
246
  (void) status;
247
246
248
  Send ();
247
  Send ();
249
}
248
}
(-)a/src/click/helper/click-internet-stack-helper.cc (-1 / +3 lines)
 Lines 24-29    Link Here 
24
24
25
#include "ns3/assert.h"
25
#include "ns3/assert.h"
26
#include "ns3/log.h"
26
#include "ns3/log.h"
27
#include "ns3/unused.h"
27
#include "ns3/object.h"
28
#include "ns3/object.h"
28
#include "ns3/names.h"
29
#include "ns3/names.h"
29
#include "ns3/ipv4.h"
30
#include "ns3/ipv4.h"
 Lines 449-459    Link Here 
449
          // be aggregated to the same node.
450
          // be aggregated to the same node.
450
          //
451
          //
451
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
452
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
452
          bool __attribute__ ((unused)) result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop",
453
          bool result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop",
453
                                                                                             MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext,
454
                                                                                             MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext,
454
                                                                                                                theStream));
455
                                                                                                                theStream));
455
          NS_ASSERT_MSG (result == true, "ClickInternetStackHelper::EanableAsciiIpv4Internal():  "
456
          NS_ASSERT_MSG (result == true, "ClickInternetStackHelper::EanableAsciiIpv4Internal():  "
456
                         "Unable to connect ipv4L3Protocol \"Drop\"");
457
                         "Unable to connect ipv4L3Protocol \"Drop\"");
458
          NS_UNUSED (result);
457
        }
459
        }
458
460
459
      g_interfaceStreamMapIpv4[std::make_pair (ipv4, interface)] = theStream;
461
      g_interfaceStreamMapIpv4[std::make_pair (ipv4, interface)] = theStream;
(-)a/src/core/examples/main-callback.cc (-6 / +4 lines)
 Lines 1-6    Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
#include "ns3/callback.h"
2
#include "ns3/callback.h"
3
#include "ns3/assert.h"
3
#include "ns3/assert.h"
4
#include "ns3/unused.h"
4
#include <iostream>
5
#include <iostream>
5
6
6
using namespace ns3;
7
using namespace ns3;
 Lines 34-42    Link Here 
34
  // invoke cbOne function through callback instance
35
  // invoke cbOne function through callback instance
35
  double retOne;
36
  double retOne;
36
  retOne = one (10.0, 20.0);
37
  retOne = one (10.0, 20.0);
37
  // cast retOne to void, to suppress variable ‘retOne’ set but
38
  NS_UNUSED (retOne); // suppress "set but not used" compiler warning in optimized builds
38
  // not used compiler warning
39
  (void) retOne; 
40
39
41
  // return type: int
40
  // return type: int
42
  // first arg type: double
41
  // first arg type: double
 Lines 49-57    Link Here 
49
  // invoke MyCb::cbTwo through callback instance
48
  // invoke MyCb::cbTwo through callback instance
50
  int retTwo;
49
  int retTwo;
51
  retTwo = two (10.0);
50
  retTwo = two (10.0);
52
  // cast retTwo to void, to suppress variable ‘retTwo’ set but
51
  NS_UNUSED (retTwo); // suppress "set but not used" compiler warning in optimized builds
53
  // not used compiler warning
52
54
  (void) retTwo;
55
  two = MakeNullCallback<int, double> ();
53
  two = MakeNullCallback<int, double> ();
56
  // invoking a null callback is just like
54
  // invoking a null callback is just like
57
  // invoking a null function pointer:
55
  // invoking a null function pointer:
(-)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 235-240    Link Here 
235
        'model/vector.h',
235
        'model/vector.h',
236
        'model/default-deleter.h',
236
        'model/default-deleter.h',
237
        'model/fatal-impl.h',
237
        'model/fatal-impl.h',
238
        'model/unused.h',
238
        ]
239
        ]
239
240
240
    if sys.platform == 'win32':
241
    if sys.platform == 'win32':
(-)a/src/flow-monitor/model/ipv4-flow-probe.cc (-3 / +3 lines)
 Lines 24-29    Link Here 
24
#include "ns3/packet.h"
24
#include "ns3/packet.h"
25
#include "ns3/flow-monitor.h"
25
#include "ns3/flow-monitor.h"
26
#include "ns3/log.h"
26
#include "ns3/log.h"
27
#include "ns3/unused.h"
27
#include "ns3/pointer.h"
28
#include "ns3/pointer.h"
28
#include "ns3/config.h"
29
#include "ns3/config.h"
29
#include "ns3/flow-id-tag.h"
30
#include "ns3/flow-id-tag.h"
 Lines 327-335    Link Here 
327
  bool tagFound;
328
  bool tagFound;
328
  tagFound = ConstCast<Packet> (ipPayload)->RemovePacketTag (fTag);
329
  tagFound = ConstCast<Packet> (ipPayload)->RemovePacketTag (fTag);
329
  NS_ASSERT_MSG (tagFound, "FlowProbeTag is missing");
330
  NS_ASSERT_MSG (tagFound, "FlowProbeTag is missing");
330
  // cast tagFound to void, to suppress 'tagFound' set but not used compiler 
331
  NS_UNUSED (tagFound); // suppress "set but not used" compiler warning in optimized builds
331
  // warning in optimized builds
332
332
  (void) tagFound;
333
  FlowId flowId = fTag.GetFlowId ();
333
  FlowId flowId = fTag.GetFlowId ();
334
  FlowPacketId packetId = fTag.GetPacketId ();
334
  FlowPacketId packetId = fTag.GetPacketId ();
335
  uint32_t size = fTag.GetPacketSize ();
335
  uint32_t size = fTag.GetPacketSize ();
(-)a/src/internet/helper/internet-stack-helper.cc (-8 / +7 lines)
 Lines 150-155    Link Here 
150
150
151
#include "ns3/assert.h"
151
#include "ns3/assert.h"
152
#include "ns3/log.h"
152
#include "ns3/log.h"
153
#include "ns3/unused.h"
153
#include "ns3/object.h"
154
#include "ns3/object.h"
154
#include "ns3/names.h"
155
#include "ns3/names.h"
155
#include "ns3/ipv4.h"
156
#include "ns3/ipv4.h"
 Lines 492-500    Link Here 
492
      result = ipv4L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv4L3ProtocolRxTxSink));
493
      result = ipv4L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv4L3ProtocolRxTxSink));
493
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv4Internal():  "
494
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv4Internal():  "
494
                     "Unable to connect ipv4L3Protocol \"Rx\"");
495
                     "Unable to connect ipv4L3Protocol \"Rx\"");
495
      // cast result to void, to suppress ‘result’ set but not used compiler-warning
496
      NS_UNUSED (result); // suppress "set but not used" compiler warning in optimized builds
496
      // for optimized builds
497
      (void) result;
498
    }
497
    }
499
498
500
  g_interfaceFileMapIpv4[std::make_pair (ipv4, interface)] = file;
499
  g_interfaceFileMapIpv4[std::make_pair (ipv4, interface)] = file;
 Lines 587-595    Link Here 
587
      result = ipv6L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv6L3ProtocolRxTxSink));
586
      result = ipv6L3Protocol->TraceConnectWithoutContext ("Rx", MakeCallback (&Ipv6L3ProtocolRxTxSink));
588
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv6Internal():  "
587
      NS_ASSERT_MSG (result == true, "InternetStackHelper::EnablePcapIpv6Internal():  "
589
                     "Unable to connect ipv6L3Protocol \"Rx\"");
588
                     "Unable to connect ipv6L3Protocol \"Rx\"");
590
      // cast found to void, to suppress ‘result’ set but not used compiler-warning
589
      NS_UNUSED (result); // suppress "set but not used" compiler warning in optimized builds
591
      // for optimized builds
592
      (void) result;
593
    }
590
    }
594
591
595
  g_interfaceFileMapIpv6[std::make_pair (ipv6, interface)] = file;
592
  g_interfaceFileMapIpv6[std::make_pair (ipv6, interface)] = file;
 Lines 742-751    Link Here 
742
          // be aggregated to the same node.
739
          // be aggregated to the same node.
743
          //
740
          //
744
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
741
          Ptr<Ipv4L3Protocol> ipv4L3Protocol = ipv4->GetObject<Ipv4L3Protocol> ();
745
          bool __attribute__ ((unused)) result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop", 
742
          bool result = ipv4L3Protocol->TraceConnectWithoutContext ("Drop", 
746
                                                                                             MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext, theStream));
743
                                                                                             MakeBoundCallback (&Ipv4L3ProtocolDropSinkWithoutContext, theStream));
747
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EanableAsciiIpv4Internal():  "
744
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EanableAsciiIpv4Internal():  "
748
                         "Unable to connect ipv4L3Protocol \"Drop\"");
745
                         "Unable to connect ipv4L3Protocol \"Drop\"");
746
          NS_UNUSED (result);
749
        }
747
        }
750
748
751
      g_interfaceStreamMapIpv4[std::make_pair (ipv4, interface)] = theStream;
749
      g_interfaceStreamMapIpv4[std::make_pair (ipv4, interface)] = theStream;
 Lines 929-938    Link Here 
929
          // be aggregated to the same node.
927
          // be aggregated to the same node.
930
          //
928
          //
931
          Ptr<Ipv6L3Protocol> ipv6L3Protocol = ipv6->GetObject<Ipv6L3Protocol> ();
929
          Ptr<Ipv6L3Protocol> ipv6L3Protocol = ipv6->GetObject<Ipv6L3Protocol> ();
932
          bool __attribute__ ((unused)) result = ipv6L3Protocol->TraceConnectWithoutContext ("Drop", 
930
          bool result = ipv6L3Protocol->TraceConnectWithoutContext ("Drop", 
933
                                                                                             MakeBoundCallback (&Ipv6L3ProtocolDropSinkWithoutContext, theStream));
931
                                                                                             MakeBoundCallback (&Ipv6L3ProtocolDropSinkWithoutContext, theStream));
934
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EnableAsciiIpv6Internal():  "
932
          NS_ASSERT_MSG (result == true, "InternetStackHelper::EnableAsciiIpv6Internal():  "
935
                         "Unable to connect ipv6L3Protocol \"Drop\"");
933
                         "Unable to connect ipv6L3Protocol \"Drop\"");
934
          NS_UNUSED (result);
936
        }
935
        }
937
936
938
      g_interfaceStreamMapIpv6[std::make_pair (ipv6, interface)] = theStream;
937
      g_interfaceStreamMapIpv6[std::make_pair (ipv6, interface)] = theStream;
(-)a/src/internet/model/tcp-socket-base.cc (-3 / +2 lines)
 Lines 25-30    Link Here 
25
#include "ns3/node.h"
25
#include "ns3/node.h"
26
#include "ns3/inet-socket-address.h"
26
#include "ns3/inet-socket-address.h"
27
#include "ns3/log.h"
27
#include "ns3/log.h"
28
#include "ns3/unused.h"
28
#include "ns3/ipv4.h"
29
#include "ns3/ipv4.h"
29
#include "ns3/ipv4-interface-address.h"
30
#include "ns3/ipv4-interface-address.h"
30
#include "ns3/ipv4-route.h"
31
#include "ns3/ipv4-route.h"
 Lines 416-424    Link Here 
416
      bool found;
417
      bool found;
417
      found = packet->PeekPacketTag (tag);
418
      found = packet->PeekPacketTag (tag);
418
      NS_ASSERT (found);
419
      NS_ASSERT (found);
419
      //cast found to void , to suppress 'found' set but not used compiler warning
420
      NS_UNUSED (found); // suppress "set but not used" compiler warning in optimized builds
420
      //in optimized builds
421
      (void) found;
422
      fromAddress = tag.GetAddress ();
421
      fromAddress = tag.GetAddress ();
423
    }
422
    }
424
  return packet;
423
  return packet;
(-)a/src/internet/model/udp-socket-impl.cc (-3 / +2 lines)
 Lines 19-24    Link Here 
19
 */
19
 */
20
20
21
#include "ns3/log.h"
21
#include "ns3/log.h"
22
#include "ns3/unused.h"
22
#include "ns3/node.h"
23
#include "ns3/node.h"
23
#include "ns3/inet-socket-address.h"
24
#include "ns3/inet-socket-address.h"
24
#include "ns3/ipv4-route.h"
25
#include "ns3/ipv4-route.h"
 Lines 547-555    Link Here 
547
      bool found;
548
      bool found;
548
      found = packet->PeekPacketTag (tag);
549
      found = packet->PeekPacketTag (tag);
549
      NS_ASSERT (found);
550
      NS_ASSERT (found);
550
      //cast found to void, to suppress 'found' set but not used,compiler warning
551
      NS_UNUSED (found); // suppress "set but not used" compiler warning in optimized builds
551
      //in optimized builds
552
      (void) found;
553
      fromAddress = tag.GetAddress ();
552
      fromAddress = tag.GetAddress ();
554
    }
553
    }
555
  return packet;
554
  return packet;
(-)a/src/internet/test/ipv4-raw-test.cc (-6 / +3 lines)
 Lines 31-36    Link Here 
31
#include "ns3/socket.h"
31
#include "ns3/socket.h"
32
32
33
#include "ns3/log.h"
33
#include "ns3/log.h"
34
#include "ns3/unused.h"
34
#include "ns3/node.h"
35
#include "ns3/node.h"
35
#include "ns3/inet-socket-address.h"
36
#include "ns3/inet-socket-address.h"
36
#include "ns3/boolean.h"
37
#include "ns3/boolean.h"
 Lines 112-120    Link Here 
112
  NS_ASSERT (m_receivedPacket->GetSize () == 2);
113
  NS_ASSERT (m_receivedPacket->GetSize () == 2);
113
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
114
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
114
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
115
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
115
  //cast availableData to void, to suppress 'availableData' set but not used
116
  NS_UNUSED (availableData); // suppress "set but not used" compiler warning in optimized builds
116
  //compiler warning
117
  (void) availableData;
118
}
117
}
119
118
120
void Ipv4RawSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
119
void Ipv4RawSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
 Lines 125-133    Link Here 
125
  NS_ASSERT (m_receivedPacket2->GetSize () == 2);
124
  NS_ASSERT (m_receivedPacket2->GetSize () == 2);
126
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
125
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
127
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
126
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
128
  //cast availableData to void, to suppress 'availableData' set but not used
127
  NS_UNUSED (availableData); // suppress "set but not used" compiler warning in optimized builds
129
  //compiler warning
130
  (void) availableData;
131
}
128
}
132
129
133
void
130
void
(-)a/src/internet/test/udp-test.cc (-9 / +4 lines)
 Lines 32-37    Link Here 
32
#include "ns3/socket.h"
32
#include "ns3/socket.h"
33
33
34
#include "ns3/log.h"
34
#include "ns3/log.h"
35
#include "ns3/unused.h"
35
#include "ns3/node.h"
36
#include "ns3/node.h"
36
#include "ns3/inet-socket-address.h"
37
#include "ns3/inet-socket-address.h"
37
38
 Lines 94-102    Link Here 
94
  availableData = socket->GetRxAvailable ();
95
  availableData = socket->GetRxAvailable ();
95
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
96
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
96
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
97
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
97
  //cast availableData to void, to suppress 'availableData' set but not used
98
  NS_UNUSED (availableData); // suppress "set but not used" compiler warning in optimized builds
98
  //compiler warning
99
  (void) availableData;
100
}
99
}
101
100
102
void
101
void
 Lines 155-163    Link Here 
155
  availableData = socket->GetRxAvailable ();
154
  availableData = socket->GetRxAvailable ();
156
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
155
  m_receivedPacket = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
157
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
156
  NS_ASSERT (availableData == m_receivedPacket->GetSize ());
158
  //cast availableData to void, to suppress 'availableData' set but not used
157
  NS_UNUSED (availableData); // suppress "set but not used" compiler warning in optimized builds
159
  //compiler warning
160
  (void) availableData;
161
}
158
}
162
159
163
void UdpSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
160
void UdpSocketImplTest::ReceivePkt2 (Ptr<Socket> socket)
 Lines 166-174    Link Here 
166
  availableData = socket->GetRxAvailable ();
163
  availableData = socket->GetRxAvailable ();
167
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
164
  m_receivedPacket2 = socket->Recv (std::numeric_limits<uint32_t>::max(), 0);
168
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
165
  NS_ASSERT (availableData == m_receivedPacket2->GetSize ());
169
  //cast availableData to void, to suppress 'availableData' set but not used
166
  NS_UNUSED (availableData); // suppress "set but not used" compiler warning in optimized builds
170
  //compiler warning
171
  (void) availableData;
172
}
167
}
173
168
174
void
169
void
(-)a/src/mesh/model/dot11s/peer-management-protocol.cc (-3 / +2 lines)
 Lines 27-32    Link Here 
27
#include "ns3/simulator.h"
27
#include "ns3/simulator.h"
28
#include "ns3/assert.h"
28
#include "ns3/assert.h"
29
#include "ns3/log.h"
29
#include "ns3/log.h"
30
#include "ns3/unused.h"
30
#include "ns3/random-variable.h"
31
#include "ns3/random-variable.h"
31
#include "ns3/mesh-wifi-interface-mac.h"
32
#include "ns3/mesh-wifi-interface-mac.h"
32
#include "ns3/mesh-wifi-interface-mac-plugin.h"
33
#include "ns3/mesh-wifi-interface-mac-plugin.h"
 Lines 385-393    Link Here 
385
  NS_ASSERT (iface != m_peerLinks.end ());
386
  NS_ASSERT (iface != m_peerLinks.end ());
386
  PeerManagementProtocolMacMap::const_iterator plugin = m_plugins.find (interface);
387
  PeerManagementProtocolMacMap::const_iterator plugin = m_plugins.find (interface);
387
  NS_ASSERT (plugin != m_plugins.end ());
388
  NS_ASSERT (plugin != m_plugins.end ());
388
  // cast plugin to void, to suppress 'plugin' set but not used, compiler warning
389
  NS_UNUSED (plugin); // suppress "set but not used" compiler warning in optimized builds
389
  // in optimized builds
390
  (void) plugin;
391
  std::map<uint32_t, Time>::const_iterator lastBeacon = m_lastBeacon.find (interface);
390
  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);
391
  std::map<uint32_t, Time>::const_iterator beaconInterval = m_beaconInterval.find (interface);
393
  if ((lastBeacon == m_lastBeacon.end ()) || (beaconInterval == m_beaconInterval.end ()))
392
  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 in optimized builds
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 (-9 / +19 lines)
 Lines 20-25    Link Here 
20
#define TRACE_HELPER_H
20
#define TRACE_HELPER_H
21
21
22
#include "ns3/assert.h"
22
#include "ns3/assert.h"
23
#include "ns3/unused.h"
23
#include "ns3/net-device-container.h"
24
#include "ns3/net-device-container.h"
24
#include "ns3/node-container.h"
25
#include "ns3/node-container.h"
25
#include "ns3/simulator.h"
26
#include "ns3/simulator.h"
 Lines 94-102    Link Here 
94
template <typename T> void
95
template <typename T> void
95
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileWrapper> file)
96
PcapHelper::HookDefaultSink (Ptr<T> object, std::string tracename, Ptr<PcapFileWrapper> file)
96
{
97
{
97
  bool __attribute__ ((unused)) result = 
98
  bool result = 
98
    object->TraceConnectWithoutContext (tracename.c_str (), MakeBoundCallback (&DefaultSink, file));
99
    object->TraceConnectWithoutContext (tracename.c_str (), 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 << "\"");
101
  NS_UNUSED (result);
100
}
102
}
101
103
102
/**
104
/**
 Lines 231-240    Link Here 
231
template <typename T> void
233
template <typename T> void
232
AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
234
AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
233
{
235
{
234
  bool __attribute__ ((unused)) result = 
236
  bool result = 
235
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultEnqueueSinkWithoutContext, file));
237
    object->TraceConnectWithoutContext (tracename, 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 << "\"");
240
  NS_UNUSED (result);
238
}
241
}
239
242
240
template <typename T> void
243
template <typename T> void
 Lines 244-262    Link Here 
244
  std::string tracename, 
247
  std::string tracename, 
245
  Ptr<OutputStreamWrapper> stream)
248
  Ptr<OutputStreamWrapper> stream)
246
{
249
{
247
  bool __attribute__ ((unused)) result = 
250
  bool result = 
248
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream));
251
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultEnqueueSinkWithContext, stream));
249
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithContext():  Unable to hook \"" 
252
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultEnqueueSinkWithContext():  Unable to hook \"" 
250
                 << tracename << "\"");
253
                 << tracename << "\"");
254
  NS_UNUSED (result);
251
}
255
}
252
256
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
  bool result = 
257
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDropSinkWithoutContext, file));
261
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDropSinkWithoutContext, file));
258
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithoutContext():  Unable to hook \"" 
262
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithoutContext():  Unable to hook \"" 
259
                 << tracename << "\"");
263
                 << tracename << "\"");
264
  NS_UNUSED (result);
260
}
265
}
261
266
262
template <typename T> void
267
template <typename T> void
 Lines 266-284    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
  bool result = 
270
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDropSinkWithContext, stream));
275
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDropSinkWithContext, stream));
271
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithContext():  Unable to hook \"" 
276
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDropSinkWithContext():  Unable to hook \"" 
272
                 << tracename << "\"");
277
                 << tracename << "\"");
278
  NS_UNUSED (result);
273
}
279
}
274
280
275
template <typename T> void
281
template <typename T> void
276
AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
282
AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
277
{
283
{
278
  bool __attribute__ ((unused)) result = 
284
  bool result = 
279
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file));
285
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultDequeueSinkWithoutContext, file));
280
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext():  Unable to hook \"" 
286
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext():  Unable to hook \"" 
281
                 << tracename << "\"");
287
                 << tracename << "\"");
288
  NS_UNUSED (result);
282
}
289
}
283
290
284
template <typename T> void
291
template <typename T> void
 Lines 288-306    Link Here 
288
  std::string tracename, 
295
  std::string tracename, 
289
  Ptr<OutputStreamWrapper> stream)
296
  Ptr<OutputStreamWrapper> stream)
290
{
297
{
291
  bool __attribute__ ((unused)) result = 
298
  bool result = 
292
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDequeueSinkWithContext, stream));
299
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultDequeueSinkWithContext, stream));
293
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithContext():  Unable to hook \"" 
300
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultDequeueSinkWithContext():  Unable to hook \"" 
294
                 << tracename << "\"");
301
                 << tracename << "\"");
302
  NS_UNUSED (result);
295
}
303
}
296
304
297
template <typename T> void
305
template <typename T> void
298
AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
306
AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext (Ptr<T> object, std::string tracename, Ptr<OutputStreamWrapper> file)
299
{
307
{
300
  bool __attribute__ ((unused)) result = 
308
  bool result = 
301
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file));
309
    object->TraceConnectWithoutContext (tracename, MakeBoundCallback (&DefaultReceiveSinkWithoutContext, file));
302
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext():  Unable to hook \"" 
310
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext():  Unable to hook \"" 
303
                 << tracename << "\"");
311
                 << tracename << "\"");
312
  NS_UNUSED (result);
304
}
313
}
305
314
306
template <typename T> void
315
template <typename T> void
 Lines 310-319    Link Here 
310
  std::string tracename, 
319
  std::string tracename, 
311
  Ptr<OutputStreamWrapper> stream)
320
  Ptr<OutputStreamWrapper> stream)
312
{
321
{
313
  bool __attribute__ ((unused)) result = 
322
  bool result = 
314
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultReceiveSinkWithContext, stream));
323
    object->TraceConnect (tracename, context, MakeBoundCallback (&DefaultReceiveSinkWithContext, stream));
315
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithContext():  Unable to hook \"" 
324
  NS_ASSERT_MSG (result == true, "AsciiTraceHelper::HookDefaultReceiveSinkWithContext():  Unable to hook \"" 
316
                 << tracename << "\"");
325
                 << tracename << "\"");
326
  NS_UNUSED (result);
317
}
327
}
318
328
319
/**
329
/**
(-)a/src/network/model/socket.cc (-3 / +2 lines)
 Lines 21-26    Link Here 
21
 */
21
 */
22
22
23
#include "ns3/log.h"
23
#include "ns3/log.h"
24
#include "ns3/unused.h"
24
#include "ns3/packet.h"
25
#include "ns3/packet.h"
25
#include "node.h"
26
#include "node.h"
26
#include "socket.h"
27
#include "socket.h"
 Lines 314-322    Link Here 
314
            }
315
            }
315
        }
316
        }
316
      NS_ASSERT_MSG (found, "Socket cannot be bound to a NetDevice not existing on the Node");
317
      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
      NS_UNUSED (found); // suppress "set but not used" compiler warning in optimized builds
318
      //in optimized builds
319
      (void) found;
320
    }
319
    }
321
  m_boundnetdevice = netdevice;
320
  m_boundnetdevice = netdevice;
322
  return;
321
  return;
(-)a/src/network/utils/packet-socket.cc (-3 / +2 lines)
 Lines 22-27    Link Here 
22
#include "packet-socket.h"
22
#include "packet-socket.h"
23
#include "packet-socket-address.h"
23
#include "packet-socket-address.h"
24
#include "ns3/log.h"
24
#include "ns3/log.h"
25
#include "ns3/unused.h"
25
#include "ns3/node.h"
26
#include "ns3/node.h"
26
#include "ns3/packet.h"
27
#include "ns3/packet.h"
27
#include "ns3/uinteger.h"
28
#include "ns3/uinteger.h"
 Lines 441-449    Link Here 
441
      bool found;
442
      bool found;
442
      found = packet->PeekPacketTag (tag);
443
      found = packet->PeekPacketTag (tag);
443
      NS_ASSERT (found);
444
      NS_ASSERT (found);
444
      //cast found to void, to suppress 'found' set but not used compiler warning
445
      NS_UNUSED (found); // suppress "set but not used" compiler warning in optimized builds
445
      //in optimized builds
446
      (void) found;
447
      fromAddress = tag.GetAddress ();
446
      fromAddress = tag.GetAddress ();
448
    }
447
    }
449
  return packet;
448
  return packet;
(-)a/src/network/utils/radiotap-header.cc (-1 / +3 lines)
 Lines 21-26    Link Here 
21
#include <iomanip>
21
#include <iomanip>
22
#include <math.h>
22
#include <math.h>
23
#include "ns3/log.h"
23
#include "ns3/log.h"
24
#include "ns3/unused.h"
24
#include "radiotap-header.h"
25
#include "radiotap-header.h"
25
26
26
NS_LOG_COMPONENT_DEFINE ("RadiotapHeader");
27
NS_LOG_COMPONENT_DEFINE ("RadiotapHeader");
 Lines 134-141    Link Here 
134
{
135
{
135
  NS_LOG_FUNCTION (this);
136
  NS_LOG_FUNCTION (this);
136
137
137
  uint8_t __attribute__ ((unused)) tmp = start.ReadU8 (); // major version of radiotap header
138
  uint8_t tmp = start.ReadU8 (); // major version of radiotap header
138
  NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version");
139
  NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version");
140
  NS_UNUSED (tmp);
139
  start.ReadU8 (); // pad field
141
  start.ReadU8 (); // pad field
140
142
141
  m_length = start.ReadU16 (); // entire length of radiotap data + header
143
  m_length = start.ReadU16 (); // entire length of radiotap data + header
(-)a/src/test/ns3wifi/wifi-interference-test-suite.cc (-3 / +2 lines)
 Lines 21-26    Link Here 
21
#include <string>
21
#include <string>
22
22
23
#include "ns3/log.h"
23
#include "ns3/log.h"
24
#include "ns3/unused.h"
24
#include "ns3/callback.h"
25
#include "ns3/callback.h"
25
#include "ns3/abort.h"
26
#include "ns3/abort.h"
26
#include "ns3/test.h"
27
#include "ns3/test.h"
 Lines 84-92    Link Here 
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
  NS_UNUSED (iaddr); // suppress "set but not used" compiler warning in optimized builds
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 / +4 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 155-165    Link Here 
155
                            << " bb: " << bb << " neighbors: " << neigh_list.size ()
156
                            << " bb: " << bb << " neighbors: " << neigh_list.size ()
156
                            << "(" << "%d" << ") externals: \"%s\"(%d) "
157
                            << "(" << "%d" << ") externals: \"%s\"(%d) "
157
                            << "name: " << name << " radius: " << radius);
158
                            << "name: " << name << " radius: " << radius);
158
159
  NS_UNUSED (bb); // suppress "set but not used" compiler warning in optimized builds
159
  //cast bb and dns to void, to suppress variable set but not used compiler warning
160
  NS_UNUSED (dns); // suppress "set but not used" compiler warning in optimized builds
160
  //in optimized builds
161
  (void) bb;
162
  (void) dns;
163
161
164
  // Create node and link
162
  // Create node and link
165
  if (!uid.empty ())
163
  if (!uid.empty ())
 Lines 209-216    Link Here 
209
  sname = argv[0];
207
  sname = argv[0];
210
  tname = argv[1];
208
  tname = argv[1];
211
  double v = strtod (argv[2], &endptr); // weight
209
  double v = strtod (argv[2], &endptr); // weight
212
  // cast v to void , to suppress 'v' set but not used compiler warning
210
  NS_UNUSED (v); // suppress "set but not used" compiler warning in optimized builds
213
  (void) v;
214
  if (*endptr != '\0')
211
  if (*endptr != '\0')
215
    {
212
    {
216
      NS_LOG_WARN ("invalid weight: " << argv[2]);
213
      NS_LOG_WARN ("invalid weight: " << argv[2]);
(-)a/src/wifi/model/wifi-information-element.cc (-3 / +2 lines)
 Lines 19-24    Link Here 
19
 */
19
 */
20
20
21
#include "ns3/wifi-information-element.h"
21
#include "ns3/wifi-information-element.h"
22
#include "ns3/unused.h"
22
23
23
namespace ns3 {
24
namespace ns3 {
24
25
 Lines 55-63    Link Here 
55
  // This IE was not optional, so confirm that we did actually
56
  // This IE was not optional, so confirm that we did actually
56
  // deserialise something.
57
  // deserialise something.
57
  NS_ASSERT (i.GetDistanceFrom (start) != 0);
58
  NS_ASSERT (i.GetDistanceFrom (start) != 0);
58
  // cast start to void, to suppress ‘start’ set but not used
59
  NS_UNUSED (start); // suppress "set but not used" compiler warning in optimized builds
59
  // compiler warning in optimized builds
60
  (void) start;
61
  return i;
60
  return i;
62
}
61
}
63
62
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-6 / +3 lines)
 Lines 22-27    Link Here 
22
#include "ns3/simulator.h"
22
#include "ns3/simulator.h"
23
#include "ns3/assert.h"
23
#include "ns3/assert.h"
24
#include "ns3/log.h"
24
#include "ns3/log.h"
25
#include "ns3/unused.h"
25
#include "ns3/tag.h"
26
#include "ns3/tag.h"
26
#include "ns3/boolean.h"
27
#include "ns3/boolean.h"
27
#include "ns3/double.h"
28
#include "ns3/double.h"
 Lines 368-376    Link Here 
368
      bool found;
369
      bool found;
369
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
370
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
370
      NS_ASSERT (found);
371
      NS_ASSERT (found);
371
      // cast found to void, to suppress 'found' set but not used
372
      NS_UNUSED (found); // suppress "set but not used" compiler warning in optimized builds
372
      // compiler warning
373
      (void) found;
374
      return tag.GetDataMode ();
373
      return tag.GetDataMode ();
375
    }
374
    }
376
  return DoGetDataMode (Lookup (address, header), fullPacketSize);
375
  return DoGetDataMode (Lookup (address, header), fullPacketSize);
 Lines 386-394    Link Here 
386
      bool found;
385
      bool found;
387
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
386
      found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
388
      NS_ASSERT (found);
387
      NS_ASSERT (found);
389
      // cast found to void, to suppress 'found' set but not used
388
      NS_UNUSED (found); // suppress "set but not used" compiler warning in optimized builds
390
      // compiler warning
391
      (void) found;
392
      return tag.GetRtsMode ();
389
      return tag.GetRtsMode ();
393
    }
390
    }
394
  return DoGetRtsMode (Lookup (address, header));
391
  return DoGetRtsMode (Lookup (address, header));

Return to bug 1170