diff --git a/examples/routing/manet-routing-compare.cc b/examples/routing/manet-routing-compare.cc index 8e30de5ce..490aa8fc0 100644 --- a/examples/routing/manet-routing-compare.cc +++ b/examples/routing/manet-routing-compare.cc @@ -296,7 +296,7 @@ RoutingExperiment::Run(int nSinks, double txp, std::string CSVfileName) NetDeviceContainer adhocDevices = wifi.Install(wifiPhy, wifiMac, adhocNodes); MobilityHelper mobilityAdhoc; - int64_t streamIndex [[maybe_unused]] = 0; // used to get consistent mobility across scenarios + int64_t streamIndex = 0; // used to get consistent mobility across scenarios ObjectFactory pos; pos.SetTypeId("ns3::RandomRectanglePositionAllocator"); diff --git a/src/applications/model/three-gpp-http-client.cc b/src/applications/model/three-gpp-http-client.cc index 0098272d5..8cfec42f2 100644 --- a/src/applications/model/three-gpp-http-client.cc +++ b/src/applications/model/three-gpp-http-client.cc @@ -363,10 +363,10 @@ ThreeGppHttpClient::OpenConnection() { m_socket = Socket::CreateSocket(GetNode(), TcpSocketFactory::GetTypeId()); - int ret [[maybe_unused]]; - if (Ipv4Address::IsMatchingType(m_remoteServerAddress)) { + int ret [[maybe_unused]]; + ret = m_socket->Bind(); NS_LOG_DEBUG(this << " Bind() return value= " << ret << " GetErrNo= " << m_socket->GetErrno() << "."); @@ -381,6 +381,8 @@ ThreeGppHttpClient::OpenConnection() } else if (Ipv6Address::IsMatchingType(m_remoteServerAddress)) { + int ret [[maybe_unused]]; + ret = m_socket->Bind6(); NS_LOG_DEBUG(this << " Bind6() return value= " << ret << " GetErrNo= " << m_socket->GetErrno() << "."); diff --git a/src/applications/model/three-gpp-http-server.cc b/src/applications/model/three-gpp-http-server.cc index 00b35bddb..e90931e9f 100644 --- a/src/applications/model/three-gpp-http-server.cc +++ b/src/applications/model/three-gpp-http-server.cc @@ -208,15 +208,13 @@ ThreeGppHttpServer::StartApplication() m_initialSocket = Socket::CreateSocket(GetNode(), TcpSocketFactory::GetTypeId()); m_initialSocket->SetAttribute("SegmentSize", UintegerValue(m_mtuSize)); - int ret [[maybe_unused]]; - if (Ipv4Address::IsMatchingType(m_localAddress)) { const Ipv4Address ipv4 = Ipv4Address::ConvertFrom(m_localAddress); const InetSocketAddress inetSocket = InetSocketAddress(ipv4, m_localPort); NS_LOG_INFO(this << " Binding on " << ipv4 << " port " << m_localPort << " / " << inetSocket << "."); - ret = m_initialSocket->Bind(inetSocket); + int ret [[maybe_unused]] = m_initialSocket->Bind(inetSocket); NS_LOG_DEBUG(this << " Bind() return value= " << ret << " GetErrNo= " << m_initialSocket->GetErrno() << "."); } @@ -226,12 +224,12 @@ ThreeGppHttpServer::StartApplication() const Inet6SocketAddress inet6Socket = Inet6SocketAddress(ipv6, m_localPort); NS_LOG_INFO(this << " Binding on " << ipv6 << " port " << m_localPort << " / " << inet6Socket << "."); - ret = m_initialSocket->Bind(inet6Socket); + int ret [[maybe_unused]] = m_initialSocket->Bind(inet6Socket); NS_LOG_DEBUG(this << " Bind() return value= " << ret << " GetErrNo= " << m_initialSocket->GetErrno() << "."); } - ret = m_initialSocket->Listen(); + int ret [[maybe_unused]] = m_initialSocket->Listen(); NS_LOG_DEBUG(this << " Listen () return value= " << ret << " GetErrNo= " << m_initialSocket->GetErrno() << "."); diff --git a/src/buildings/model/buildings-channel-condition-model.cc b/src/buildings/model/buildings-channel-condition-model.cc index 0615ae22f..bed68dc72 100644 --- a/src/buildings/model/buildings-channel-condition-model.cc +++ b/src/buildings/model/buildings-channel-condition-model.cc @@ -132,7 +132,7 @@ BuildingsChannelConditionModel::IsLineOfSightBlocked(const ns3::Vector& l1, } int64_t -BuildingsChannelConditionModel::AssignStreams(int64_t stream [[maybe_unused]]) +BuildingsChannelConditionModel::AssignStreams(int64_t /* stream */) { return 0; } diff --git a/src/core/model/attribute-accessor-helper.h b/src/core/model/attribute-accessor-helper.h index 575f95a36..1beccfbc5 100644 --- a/src/core/model/attribute-accessor-helper.h +++ b/src/core/model/attribute-accessor-helper.h @@ -327,7 +327,7 @@ DoMakeAccessorHelperOne(U (T::*getter)() const) } private: - bool DoSet(T* object [[maybe_unused]], const V* v [[maybe_unused]]) const override + bool DoSet(T* /* object */, const V* /* v */) const override { return false; } @@ -398,7 +398,7 @@ DoMakeAccessorHelperOne(void (T::*setter)(U)) return true; } - bool DoGet(const T* object [[maybe_unused]], V* v [[maybe_unused]]) const override + bool DoGet(const T* /* object */, V* /* v */) const override { return false; } diff --git a/src/core/test/simulator-test-suite.cc b/src/core/test/simulator-test-suite.cc index ff285b45c..76515dde2 100644 --- a/src/core/test/simulator-test-suite.cc +++ b/src/core/test/simulator-test-suite.cc @@ -107,7 +107,7 @@ SimulatorEventsTestCase::NowUs() } void -SimulatorEventsTestCase::EventA(int a [[maybe_unused]]) +SimulatorEventsTestCase::EventA(int /* a */) { m_a = false; } @@ -128,7 +128,7 @@ SimulatorEventsTestCase::EventB(int b) } void -SimulatorEventsTestCase::EventC(int c [[maybe_unused]]) +SimulatorEventsTestCase::EventC(int /* c */) { m_c = false; } diff --git a/src/core/test/traced-callback-test-suite.cc b/src/core/test/traced-callback-test-suite.cc index e4388620d..ded8f8e06 100644 --- a/src/core/test/traced-callback-test-suite.cc +++ b/src/core/test/traced-callback-test-suite.cc @@ -66,7 +66,7 @@ BasicTracedCallbackTestCase::BasicTracedCallbackTestCase() } void -BasicTracedCallbackTestCase::CbOne(uint8_t a [[maybe_unused]], double b [[maybe_unused]]) +BasicTracedCallbackTestCase::CbOne(uint8_t /* a */, double /* b */) { m_one = true; } diff --git a/src/dsr/model/dsr-options.cc b/src/dsr/model/dsr-options.cc index 9504676ce..d8c458284 100644 --- a/src/dsr/model/dsr-options.cc +++ b/src/dsr/model/dsr-options.cc @@ -1594,10 +1594,6 @@ DsrOptionRerr::Process(Ptr packet, */ Ptr node = GetNodeWithAddress(ipv4Address); Ptr dsr = node->GetObject(); - /* - * The error serialized size - */ - uint32_t rerrSize [[maybe_unused]]; NS_LOG_DEBUG("The error type value here " << (uint32_t)errorType); if (errorType == 1) // unreachable ip address { @@ -1617,7 +1613,7 @@ DsrOptionRerr::Process(Ptr packet, /* * Get the serialized size of the rerr header */ - rerrSize = rerrUnreach.GetSerializedSize(); + uint32_t rerrSize = rerrUnreach.GetSerializedSize(); /* * Delete all the routes including the unreachable node address from the route cache */ @@ -1640,9 +1636,9 @@ DsrOptionRerr::Process(Ptr packet, */ DsrOptionRerrUnsupportHeader rerrUnsupport; p->RemoveHeader(rerrUnsupport); - rerrSize = rerrUnsupport.GetSerializedSize(); /// \todo This is for the other two error options, not supporting for now + // uint32_t rerrSize = rerrUnsupport.GetSerializedSize(); // uint32_t serialized = DoSendError (p, rerrUnsupport, rerrSize, ipv4Address, protocol); uint32_t serialized = 0; return serialized; diff --git a/src/internet/model/tcp-congestion-ops.cc b/src/internet/model/tcp-congestion-ops.cc index 148c23e5d..289e2a75d 100644 --- a/src/internet/model/tcp-congestion-ops.cc +++ b/src/internet/model/tcp-congestion-ops.cc @@ -81,8 +81,8 @@ TcpCongestionOps::HasCongControl() const void TcpCongestionOps::CongControl(Ptr tcb, - const TcpRateOps::TcpRateConnection& rc [[maybe_unused]], - const TcpRateOps::TcpRateSample& rs [[maybe_unused]]) + const TcpRateOps::TcpRateConnection& /* rc */, + const TcpRateOps::TcpRateSample& /* rs */) { NS_LOG_FUNCTION(this << tcb); } diff --git a/src/internet/model/tcp-socket-base.cc b/src/internet/model/tcp-socket-base.cc index f8ef04188..7f85a1300 100644 --- a/src/internet/model/tcp-socket-base.cc +++ b/src/internet/model/tcp-socket-base.cc @@ -892,7 +892,7 @@ TcpSocketBase::Send(Ptr p, uint32_t flags) /* Inherit from Socket class: In TcpSocketBase, it is same as Send() call */ int -TcpSocketBase::SendTo(Ptr p, uint32_t flags, const Address& address [[maybe_unused]]) +TcpSocketBase::SendTo(Ptr p, uint32_t flags, const Address& /* address */) { return Send(p, flags); // SendTo() and Send() are the same } @@ -2369,7 +2369,7 @@ void TcpSocketBase::ProcessSynRcvd(Ptr packet, const TcpHeader& tcpHeader, const Address& fromAddress, - const Address& toAddress [[maybe_unused]]) + const Address& /* toAddress */) { NS_LOG_FUNCTION(this << tcpHeader); diff --git a/src/internet/test/tcp-general-test.cc b/src/internet/test/tcp-general-test.cc index dc21d2f89..58f626db9 100644 --- a/src/internet/test/tcp-general-test.cc +++ b/src/internet/test/tcp-general-test.cc @@ -364,7 +364,7 @@ TcpGeneralTest::QueueDropCb(std::string context, Ptr p) } void -TcpGeneralTest::PhyDropCb(std::string context, Ptr p [[maybe_unused]]) +TcpGeneralTest::PhyDropCb(std::string context, Ptr /* p */) { if (context == "SENDER") { diff --git a/src/internet/test/tcp-hybla-test.cc b/src/internet/test/tcp-hybla-test.cc index 5ced133dc..18eb185fb 100644 --- a/src/internet/test/tcp-hybla-test.cc +++ b/src/internet/test/tcp-hybla-test.cc @@ -82,7 +82,7 @@ TcpHyblaIncrementTest::TcpHyblaIncrementTest(uint32_t cWnd, } void -TcpHyblaIncrementTest::RhoUpdated(double oldVal [[maybe_unused]], double newVal) +TcpHyblaIncrementTest::RhoUpdated(double /* oldVal */, double newVal) { m_rho = newVal; } diff --git a/src/internet/test/tcp-rate-ops-test.cc b/src/internet/test/tcp-rate-ops-test.cc index f243ce8d3..5a8b95dfe 100644 --- a/src/internet/test/tcp-rate-ops-test.cc +++ b/src/internet/test/tcp-rate-ops-test.cc @@ -381,8 +381,7 @@ TcpRateLinuxWithSocketsTest::Rx(const Ptr p, const TcpHeader& h, S } void -TcpRateLinuxWithSocketsTest::BytesInFlightTrace(uint32_t oldValue [[maybe_unused]], - uint32_t newValue) +TcpRateLinuxWithSocketsTest::BytesInFlightTrace(uint32_t /* oldValue */, uint32_t newValue) { m_bytesInFlight = newValue; } diff --git a/src/lr-wpan/model/lr-wpan-csmaca.cc b/src/lr-wpan/model/lr-wpan-csmaca.cc index d4ac26469..bafc1db7d 100644 --- a/src/lr-wpan/model/lr-wpan-csmaca.cc +++ b/src/lr-wpan/model/lr-wpan-csmaca.cc @@ -193,25 +193,21 @@ LrWpanCsmaCa::GetTimeToNextSlot() const // or other device/incoming frame (Rx beacon time reference ). Time elapsedSuperframe; // (i.e The beacon + the elapsed CAP) - Time currentTime; + Time currentTime = Simulator::Now(); double symbolsToBoundary; Time nextBoundary; uint64_t elapsedSuperframeSymbols; - uint64_t symbolRate; + uint64_t symbolRate = + (uint64_t)m_mac->GetPhy()->GetDataOrSymbolRate(false); // symbols per second Time timeAtBoundary; - Time elapsedCap [[maybe_unused]]; - Time beaconTime [[maybe_unused]]; - - currentTime = Simulator::Now(); - symbolRate = (uint64_t)m_mac->GetPhy()->GetDataOrSymbolRate(false); // symbols per second if (m_coorDest) { // Take the Incoming Frame Reference elapsedSuperframe = currentTime - m_mac->m_macBeaconRxTime; - beaconTime = Seconds((double)m_mac->m_rxBeaconSymbols / symbolRate); - elapsedCap = elapsedSuperframe - beaconTime; + Time beaconTime [[maybe_unused]] = Seconds((double)m_mac->m_rxBeaconSymbols / symbolRate); + Time elapsedCap [[maybe_unused]] = elapsedSuperframe - beaconTime; NS_LOG_DEBUG("Elapsed incoming CAP symbols: " << (elapsedCap.GetSeconds() * symbolRate) << " (" << elapsedCap.As(Time::S) << ")"); } diff --git a/src/lte/model/no-op-component-carrier-manager.cc b/src/lte/model/no-op-component-carrier-manager.cc index 40564737c..5bf125e08 100644 --- a/src/lte/model/no-op-component-carrier-manager.cc +++ b/src/lte/model/no-op-component-carrier-manager.cc @@ -475,7 +475,7 @@ RrComponentCarrierManager::DoUlReceiveMacCe(MacCeListElement_s bsr, uint8_t comp } void -RrComponentCarrierManager::DoUlReceiveSr(uint16_t rnti, uint8_t componentCarrierId [[maybe_unused]]) +RrComponentCarrierManager::DoUlReceiveSr(uint16_t rnti, uint8_t /* componentCarrierId */) { NS_LOG_FUNCTION(this); // split traffic in uplink equally among carriers diff --git a/src/mobility/helper/ns2-mobility-helper.cc b/src/mobility/helper/ns2-mobility-helper.cc index 49fe0de4b..e19a16831 100644 --- a/src/mobility/helper/ns2-mobility-helper.cc +++ b/src/mobility/helper/ns2-mobility-helper.cc @@ -608,7 +608,7 @@ bool IsNumber(const std::string& s) { char* endp; - double v [[maybe_unused]] = strtod(s.c_str(), &endp); + strtod(s.c_str(), &endp); return endp == s.c_str() + s.size(); } diff --git a/src/netanim/model/animation-interface.cc b/src/netanim/model/animation-interface.cc index 5361f3386..6b1c37420 100644 --- a/src/netanim/model/animation-interface.cc +++ b/src/netanim/model/animation-interface.cc @@ -925,8 +925,8 @@ AnimationInterface::UanPhyGenRxTrace(std::string context, Ptr p) void AnimationInterface::WifiPhyTxBeginTrace(std::string context, WifiConstPsduMap psduMap, - WifiTxVector txVector [[maybe_unused]], - double txPowerW) + WifiTxVector /* txVector */, + double /* txPowerW */) { NS_LOG_FUNCTION(this); CHECK_STARTED_INTIMEWINDOW_TRACKPACKETS; diff --git a/src/network/test/packet-test-suite.cc b/src/network/test/packet-test-suite.cc index a0cd46d01..55b78af33 100644 --- a/src/network/test/packet-test-suite.cc +++ b/src/network/test/packet-test-suite.cc @@ -1037,7 +1037,7 @@ PacketTagListTest::CheckRef(const PacketTagList& ref, ATestTagBase& t, const cha ATestTag<5> t5(1); \ ATestTag<6> t6(1); \ ATestTag<7> t7(1); \ - const int tagLast [[maybe_unused]] = 7; /* length of ref PacketTagList */ + constexpr int TAG_LAST [[maybe_unused]] = 7; /* length of ref PacketTagList */ void PacketTagListTest::CheckRefList(const PacketTagList& ptl, const char* msg, int miss /* = 0 */) @@ -1215,10 +1215,10 @@ PacketTagListTest::DoRun() std::cout << GetName() << "remove timing" << std::endl; // tags numbered from 1, so add one for (unused) entry at 0 - std::vector rmn(tagLast + 1, std::numeric_limits::max()); + std::vector rmn(TAG_LAST + 1, std::numeric_limits::max()); for (int i = 0; i < nIterations; ++i) { - for (int j = 1; j <= tagLast; ++j) + for (int j = 1; j <= TAG_LAST; ++j) { int now = 0; switch (j) @@ -1252,7 +1252,7 @@ PacketTagListTest::DoRun() } } // for tag j } // for iteration i - for (int j = tagLast; j > 0; --j) + for (int j = TAG_LAST; j > 0; --j) { std::cout << GetName() << "min remove time: t" << j << ": " << std::setw(8) << rmn[j] << " ticks" << std::endl; diff --git a/src/network/utils/queue-size.cc b/src/network/utils/queue-size.cc index c69333c0c..6c5fbb160 100644 --- a/src/network/utils/queue-size.cc +++ b/src/network/utils/queue-size.cc @@ -189,7 +189,7 @@ QueueSize::GetValue() const QueueSize::QueueSize(std::string size) { NS_LOG_FUNCTION(this << size); - bool ok [[maybe_unused]] = DoParse(size, &m_unit, &m_value); + bool ok = DoParse(size, &m_unit, &m_value); NS_ABORT_MSG_IF(!ok, "Could not parse queue size: " << size); } diff --git a/src/propagation/model/channel-condition-model.cc b/src/propagation/model/channel-condition-model.cc index 20fc3cb11..bbac4db2b 100644 --- a/src/propagation/model/channel-condition-model.cc +++ b/src/propagation/model/channel-condition-model.cc @@ -203,9 +203,8 @@ AlwaysLosChannelConditionModel::~AlwaysLosChannelConditionModel() } Ptr -AlwaysLosChannelConditionModel::GetChannelCondition(Ptr a [[maybe_unused]], - Ptr b - [[maybe_unused]]) const +AlwaysLosChannelConditionModel::GetChannelCondition(Ptr /* a */, + Ptr /* b */) const { Ptr c = CreateObject(ChannelCondition::LOS); @@ -241,9 +240,8 @@ NeverLosChannelConditionModel::~NeverLosChannelConditionModel() } Ptr -NeverLosChannelConditionModel::GetChannelCondition(Ptr a [[maybe_unused]], - Ptr b - [[maybe_unused]]) const +NeverLosChannelConditionModel::GetChannelCondition(Ptr /* a */, + Ptr /* b */) const { Ptr c = CreateObject(ChannelCondition::NLOS); @@ -408,8 +406,8 @@ ThreeGppChannelConditionModel::GetChannelCondition(Ptr a, } ChannelCondition::O2iConditionValue -ThreeGppChannelConditionModel::ComputeO2i(Ptr a [[maybe_unused]], - Ptr b [[maybe_unused]]) const +ThreeGppChannelConditionModel::ComputeO2i(Ptr a, + Ptr b) const { double o2iProb = m_uniformVarO2i->GetValue(0, 1); diff --git a/src/propagation/model/three-gpp-propagation-loss-model.cc b/src/propagation/model/three-gpp-propagation-loss-model.cc index b7dbbc371..c49a88d14 100644 --- a/src/propagation/model/three-gpp-propagation-loss-model.cc +++ b/src/propagation/model/three-gpp-propagation-loss-model.cc @@ -726,10 +726,7 @@ ThreeGppRmaPropagationLossModel::GetShadowingCorrelationDistance( } double -ThreeGppRmaPropagationLossModel::Pl1(double frequency, - double distance3D, - double h, - double w [[maybe_unused]]) +ThreeGppRmaPropagationLossModel::Pl1(double frequency, double distance3D, double h, double /* w */) { double loss = 20.0 * log10(40.0 * M_PI * distance3D * frequency / 1e9 / 3.0) + std::min(0.03 * pow(h, 1.72), 10.0) * log10(distance3D) - @@ -925,8 +922,8 @@ ThreeGppUmaPropagationLossModel::GetLossNlos(double distance2D, } double -ThreeGppUmaPropagationLossModel::GetShadowingStd(Ptr a [[maybe_unused]], - Ptr b [[maybe_unused]], +ThreeGppUmaPropagationLossModel::GetShadowingStd(Ptr /* a */, + Ptr /* b */, ChannelCondition::LosConditionValue cond) const { NS_LOG_FUNCTION(this); @@ -1013,7 +1010,7 @@ ThreeGppUmiStreetCanyonPropagationLossModel::~ThreeGppUmiStreetCanyonPropagation double ThreeGppUmiStreetCanyonPropagationLossModel::GetBpDistance(double hUt, double hBs, - double distance2D [[maybe_unused]]) const + double /* distance2D */) const { NS_LOG_FUNCTION(this); @@ -1174,8 +1171,8 @@ ThreeGppUmiStreetCanyonPropagationLossModel::GetUtAndBsHeights(double za, double double ThreeGppUmiStreetCanyonPropagationLossModel::GetShadowingStd( - Ptr a [[maybe_unused]], - Ptr b [[maybe_unused]], + Ptr /* a */, + Ptr /* b */, ChannelCondition::LosConditionValue cond) const { NS_LOG_FUNCTION(this); @@ -1256,10 +1253,10 @@ ThreeGppIndoorOfficePropagationLossModel::GetO2iDistance2dIn() const } double -ThreeGppIndoorOfficePropagationLossModel::GetLossLos(double distance2D [[maybe_unused]], - double distance3D [[maybe_unused]], - double hUt [[maybe_unused]], - double hBs [[maybe_unused]]) const +ThreeGppIndoorOfficePropagationLossModel::GetLossLos(double /* distance2D */, + double distance3D, + double /* hUt */, + double /* hBs */) const { NS_LOG_FUNCTION(this); @@ -1306,8 +1303,8 @@ ThreeGppIndoorOfficePropagationLossModel::GetLossNlos(double distance2D, double ThreeGppIndoorOfficePropagationLossModel::GetShadowingStd( - Ptr a [[maybe_unused]], - Ptr b [[maybe_unused]], + Ptr /* a */, + Ptr /* b */, ChannelCondition::LosConditionValue cond) const { NS_LOG_FUNCTION(this); diff --git a/src/stats/model/sqlite-output.cc b/src/stats/model/sqlite-output.cc index 94123e3e4..7a51aad10 100644 --- a/src/stats/model/sqlite-output.cc +++ b/src/stats/model/sqlite-output.cc @@ -90,7 +90,7 @@ SQLiteOutput::SpinPrepare(sqlite3_stmt** stmt, const std::string& cmd) const template T -SQLiteOutput::RetrieveColumn(sqlite3_stmt* stmt [[maybe_unused]], int pos [[maybe_unused]]) const +SQLiteOutput::RetrieveColumn(sqlite3_stmt* /* stmt */, int /* pos */) const { NS_FATAL_ERROR("Can't call generic fn"); } @@ -121,9 +121,7 @@ SQLiteOutput::RetrieveColumn(sqlite3_stmt* stmt, int pos) const template bool -SQLiteOutput::Bind(sqlite3_stmt* stmt [[maybe_unused]], - int pos [[maybe_unused]], - const T& value [[maybe_unused]]) const +SQLiteOutput::Bind(sqlite3_stmt* /* stmt */, int /* pos */, const T& /* value */) const { NS_FATAL_ERROR("Can't call generic fn"); return false; diff --git a/src/test/ns3tc/fq-cobalt-queue-disc-test-suite.cc b/src/test/ns3tc/fq-cobalt-queue-disc-test-suite.cc index 1aa2fff34..1434325fc 100644 --- a/src/test/ns3tc/fq-cobalt-queue-disc-test-suite.cc +++ b/src/test/ns3tc/fq-cobalt-queue-disc-test-suite.cc @@ -865,8 +865,7 @@ FqCobaltQueueDiscEcnMarking::DequeueWithDelay(Ptr queue, } void -FqCobaltQueueDiscEcnMarking::DropNextTracer(int64_t oldVal [[maybe_unused]], - int64_t newVal [[maybe_unused]]) +FqCobaltQueueDiscEcnMarking::DropNextTracer(int64_t /* oldVal */, int64_t /* newVal */) { m_dropNextCount++; } diff --git a/src/topology-read/model/rocketfuel-topology-reader.cc b/src/topology-read/model/rocketfuel-topology-reader.cc index 303450406..20db03481 100644 --- a/src/topology-read/model/rocketfuel-topology-reader.cc +++ b/src/topology-read/model/rocketfuel-topology-reader.cc @@ -256,7 +256,7 @@ RocketfuelTopologyReader::GenerateFromWeightsFile(const std::vector sname = argv[0]; tname = argv[1]; - double v [[maybe_unused]] = std::stod(argv[2], &endptr); // weight + std::stod(argv[2], &endptr); // weight if (argv[2].size() != endptr) { diff --git a/src/traffic-control/test/cobalt-queue-disc-test-suite.cc b/src/traffic-control/test/cobalt-queue-disc-test-suite.cc index d5be8f154..f7c313cb4 100644 --- a/src/traffic-control/test/cobalt-queue-disc-test-suite.cc +++ b/src/traffic-control/test/cobalt-queue-disc-test-suite.cc @@ -437,8 +437,7 @@ CobaltQueueDiscMarkTest::CobaltQueueDiscMarkTest(QueueSizeUnit mode) } void -CobaltQueueDiscMarkTest::DropNextTracer(int64_t oldVal [[maybe_unused]], - int64_t newVal [[maybe_unused]]) +CobaltQueueDiscMarkTest::DropNextTracer(int64_t /* oldVal */, int64_t /* newVal */) { m_dropNextCount++; } diff --git a/src/traffic-control/test/codel-queue-disc-test-suite.cc b/src/traffic-control/test/codel-queue-disc-test-suite.cc index 559085b18..f901737bc 100644 --- a/src/traffic-control/test/codel-queue-disc-test-suite.cc +++ b/src/traffic-control/test/codel-queue-disc-test-suite.cc @@ -513,8 +513,7 @@ CoDelQueueDiscBasicDrop::CoDelQueueDiscBasicDrop(QueueSizeUnit mode) } void -CoDelQueueDiscBasicDrop::DropNextTracer(uint32_t oldVal [[maybe_unused]], - uint32_t newVal [[maybe_unused]]) +CoDelQueueDiscBasicDrop::DropNextTracer(uint32_t /* oldVal */, uint32_t /* newVal */) { m_dropNextCount++; } @@ -731,8 +730,7 @@ CoDelQueueDiscBasicMark::CoDelQueueDiscBasicMark(QueueSizeUnit mode) } void -CoDelQueueDiscBasicMark::DropNextTracer(uint32_t oldVal [[maybe_unused]], - uint32_t newVal [[maybe_unused]]) +CoDelQueueDiscBasicMark::DropNextTracer(uint32_t /* oldVal */, uint32_t /* newVal */) { m_dropNextCount++; } diff --git a/src/uan/model/uan-mac-aloha.cc b/src/uan/model/uan-mac-aloha.cc index d4c7ed1c7..b4d4caa0d 100644 --- a/src/uan/model/uan-mac-aloha.cc +++ b/src/uan/model/uan-mac-aloha.cc @@ -118,7 +118,7 @@ UanMacAloha::AttachPhy(Ptr phy) } void -UanMacAloha::RxPacketGood(Ptr pkt, double sinr [[maybe_unused]], UanTxMode txMode) +UanMacAloha::RxPacketGood(Ptr pkt, double /* sinr */, UanTxMode /* txMode */) { UanHeaderCommon header; pkt->RemoveHeader(header); diff --git a/src/uan/model/uan-mac-cw.cc b/src/uan/model/uan-mac-cw.cc index ea5fd2dfb..71b7ceb44 100644 --- a/src/uan/model/uan-mac-cw.cc +++ b/src/uan/model/uan-mac-cw.cc @@ -333,7 +333,7 @@ UanMacCw::GetSlotTime() } void -UanMacCw::PhyRxPacketGood(Ptr packet, double sinr [[maybe_unused]], UanTxMode mode) +UanMacCw::PhyRxPacketGood(Ptr packet, double /* sinr */, UanTxMode /* mode */) { UanHeaderCommon header; packet->RemoveHeader(header); @@ -346,7 +346,7 @@ UanMacCw::PhyRxPacketGood(Ptr packet, double sinr [[maybe_unused]], UanT } void -UanMacCw::PhyRxPacketError(Ptr packet, double sinr [[maybe_unused]]) +UanMacCw::PhyRxPacketError(Ptr /* packet */, double /* sinr */) { } diff --git a/src/uan/model/uan-mac-rc-gw.cc b/src/uan/model/uan-mac-rc-gw.cc index 34976c37a..e69cfd7a4 100644 --- a/src/uan/model/uan-mac-rc-gw.cc +++ b/src/uan/model/uan-mac-rc-gw.cc @@ -176,9 +176,9 @@ UanMacRcGw::GetTypeId() } bool -UanMacRcGw::Enqueue(Ptr packet, - uint16_t protocolNumber [[maybe_unused]], - const Address& dest [[maybe_unused]]) +UanMacRcGw::Enqueue(Ptr /* packet */, + uint16_t /* protocolNumber */, + const Address& /* dest */) { NS_LOG_WARN("RCMAC Gateway transmission to acoustic nodes is not yet implemented"); return false; @@ -199,12 +199,12 @@ UanMacRcGw::AttachPhy(Ptr phy) } void -UanMacRcGw::ReceiveError(Ptr pkt, double sinr [[maybe_unused]]) +UanMacRcGw::ReceiveError(Ptr /* pkt */, double /* sinr */) { } void -UanMacRcGw::ReceivePacket(Ptr pkt, double sinr [[maybe_unused]], UanTxMode mode) +UanMacRcGw::ReceivePacket(Ptr pkt, double /* sinr */, UanTxMode mode) { UanHeaderCommon ch; pkt->PeekHeader(ch); @@ -559,7 +559,7 @@ UanMacRcGw::SendPacket(Ptr pkt, uint32_t rate) double UanMacRcGw::ComputeAlpha(uint32_t totalFrames, uint32_t totalBytes, - uint32_t n [[maybe_unused]], + uint32_t /* n */, uint32_t a, double deltaK) { diff --git a/src/uan/model/uan-mac-rc.cc b/src/uan/model/uan-mac-rc.cc index 3ef029ec5..af1e0a8e8 100644 --- a/src/uan/model/uan-mac-rc.cc +++ b/src/uan/model/uan-mac-rc.cc @@ -143,7 +143,7 @@ Reservation::IncrementRetry() } void -Reservation::SetTransmitted(bool t [[maybe_unused]]) +Reservation::SetTransmitted(bool /* t */) { m_transmitted = true; } @@ -324,7 +324,7 @@ UanMacRc::AttachPhy(Ptr phy) } void -UanMacRc::ReceiveOkFromPhy(Ptr pkt, double sinr [[maybe_unused]], UanTxMode mode) +UanMacRc::ReceiveOkFromPhy(Ptr pkt, double /* sinr */, UanTxMode mode) { UanHeaderCommon ch; pkt->RemoveHeader(ch); @@ -349,7 +349,7 @@ UanMacRc::ReceiveOkFromPhy(Ptr pkt, double sinr [[maybe_unused]], UanTxM break; case TYPE_RTS: // Currently don't respond to RTS packets at non-gateway nodes - // (Code assumes single network neighberhood) + // (Code assumes single network neighborhood) break; case TYPE_CTS: { uint32_t ctsBytes = ch.GetSerializedSize() + pkt->GetSize(); diff --git a/src/uan/model/uan-net-device.cc b/src/uan/model/uan-net-device.cc index d1b4fd891..603e33fba 100644 --- a/src/uan/model/uan-net-device.cc +++ b/src/uan/model/uan-net-device.cc @@ -281,7 +281,7 @@ UanNetDevice::IsMulticast() const } Address -UanNetDevice::GetMulticast(Ipv4Address multicastGroup [[maybe_unused]]) const +UanNetDevice::GetMulticast(Ipv4Address /* multicastGroup */) const { return m_mac->GetBroadcast(); } @@ -315,13 +315,13 @@ UanNetDevice::Send(Ptr packet, const Address& dest, uint16_t protocolNum } bool -UanNetDevice::SendFrom(Ptr packet, - const Address& source [[maybe_unused]], - const Address& dest [[maybe_unused]], - uint16_t protocolNumber [[maybe_unused]]) +UanNetDevice::SendFrom(Ptr /* packet */, + const Address& /* source */, + const Address& /* dest */, + uint16_t /* protocolNumber */) { // Not yet implemented - NS_ASSERT_MSG(0, "Not yet implemented"); + NS_ASSERT_MSG(false, "Not yet implemented"); return false; } diff --git a/src/uan/model/uan-phy-dual.cc b/src/uan/model/uan-phy-dual.cc index 5dd4345f8..54d91e070 100644 --- a/src/uan/model/uan-phy-dual.cc +++ b/src/uan/model/uan-phy-dual.cc @@ -294,10 +294,10 @@ UanPhyDual::RegisterListener(UanPhyListener* listener) } void -UanPhyDual::StartRxPacket(Ptr pkt, - double rxPowerDb [[maybe_unused]], - UanTxMode txMode, - UanPdp pdp) +UanPhyDual::StartRxPacket(Ptr /* pkt */, + double /* rxPowerDb */, + UanTxMode /* txMode */, + UanPdp /* pdp */) { // Not called. StartRxPacket in m_phy1 and m_phy2 are called directly from Transducer. } @@ -523,9 +523,9 @@ UanPhyDual::SetMac(Ptr mac) } void -UanPhyDual::NotifyTransStartTx(Ptr packet, - double txPowerDb [[maybe_unused]], - UanTxMode txMode) +UanPhyDual::NotifyTransStartTx(Ptr /* packet */, + double /* txPowerDb */, + UanTxMode /* txMode */) { } diff --git a/src/uan/model/uan-phy-dual.h b/src/uan/model/uan-phy-dual.h index 4aa7dd68f..596044037 100644 --- a/src/uan/model/uan-phy-dual.h +++ b/src/uan/model/uan-phy-dual.h @@ -133,7 +133,7 @@ class UanPhyDual : public UanPhy UanTxMode GetMode(uint32_t n) override; void Clear() override; - void SetSleepMode(bool sleep [[maybe_unused]]) override + void SetSleepMode(bool /* sleep */) override { /// \todo This method has to be implemented } diff --git a/src/uan/model/uan-phy-gen.cc b/src/uan/model/uan-phy-gen.cc index 81304927d..af5823ecb 100644 --- a/src/uan/model/uan-phy-gen.cc +++ b/src/uan/model/uan-phy-gen.cc @@ -833,7 +833,7 @@ UanPhyGen::StartRxPacket(Ptr pkt, double rxPowerDb, UanTxMode txMode, Ua } void -UanPhyGen::RxEndEvent(Ptr pkt, double rxPowerDb [[maybe_unused]], UanTxMode txMode) +UanPhyGen::RxEndEvent(Ptr pkt, double /* rxPowerDb */, UanTxMode txMode) { if (pkt != m_pktRx) { @@ -1048,9 +1048,9 @@ UanPhyGen::AssignStreams(int64_t stream) } void -UanPhyGen::NotifyTransStartTx(Ptr packet, - double txPowerDb [[maybe_unused]], - UanTxMode txMode) +UanPhyGen::NotifyTransStartTx(Ptr /* packet */, + double /* txPowerDb */, + UanTxMode /* txMode */) { if (m_pktRx) { diff --git a/src/uan/test/uan-energy-model-test.cc b/src/uan/test/uan-energy-model-test.cc index 9199a8a3d..66f5e40a4 100644 --- a/src/uan/test/uan-energy-model-test.cc +++ b/src/uan/test/uan-energy-model-test.cc @@ -111,10 +111,10 @@ AcousticModemEnergyTestCase::SendOnePacket(Ptr node) } bool -AcousticModemEnergyTestCase::RxPacket(Ptr dev, +AcousticModemEnergyTestCase::RxPacket(Ptr /* dev */, Ptr pkt, - uint16_t mode [[maybe_unused]], - const Address& sender [[maybe_unused]]) + uint16_t /* mode */, + const Address& /* sender */) { // increase the total bytes received m_bytesRx += pkt->GetSize(); diff --git a/src/uan/test/uan-test.cc b/src/uan/test/uan-test.cc index 2b33d9bcb..19064adde 100644 --- a/src/uan/test/uan-test.cc +++ b/src/uan/test/uan-test.cc @@ -102,10 +102,10 @@ UanTest::UanTest() } bool -UanTest::RxPacket(Ptr dev, +UanTest::RxPacket(Ptr /* dev */, Ptr pkt, - uint16_t mode [[maybe_unused]], - const Address& sender [[maybe_unused]]) + uint16_t /* mode */, + const Address& /* sender */) { m_bytesRx += pkt->GetSize(); return true; diff --git a/src/wave/helper/wave-helper.cc b/src/wave/helper/wave-helper.cc index a0b97c50c..1da14b52d 100644 --- a/src/wave/helper/wave-helper.cc +++ b/src/wave/helper/wave-helper.cc @@ -48,9 +48,9 @@ static void AsciiPhyTransmitSinkWithContext(Ptr stream, std::string context, Ptr p, - WifiMode mode, - WifiPreamble preamble, - uint8_t txLevel) + WifiMode mode [[maybe_unused]], + WifiPreamble preamble [[maybe_unused]], + uint8_t txLevel [[maybe_unused]]) { NS_LOG_FUNCTION(stream << context << p << mode << preamble << txLevel); *stream->GetStream() << "t " << Simulator::Now().GetSeconds() << " " << context << " " << *p @@ -129,7 +129,7 @@ YansWavePhyHelper::Default() void YansWavePhyHelper::EnablePcapInternal(std::string prefix, Ptr nd, - bool promiscuous, + bool /* promiscuous */, bool explicitFilename) { //