From 529e55873ecd23e7748117605f379eb9318a6f61 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Mon, 12 Dec 2011 14:42:06 +0100 Subject: [PATCH] Silence more PC-Lint warnings --- pclint.lnt | 3 +++ src/config/configuration.cpp | 2 +- src/host/messagepayload.cpp | 4 ++-- src/host/pinger.cpp | 1 + src/host/pingerfactory.cpp | 6 +++--- src/host/pingscheduler.cpp | 2 +- src/icmp/icmpmessage.cpp | 1 + src/icmp/icmppacket.cpp | 1 + src/icmp/icmppinger.cpp | 4 ++-- src/icmp/icmpv6packet.cpp | 3 +++ src/link/linkstatusanalyzer.cpp | 4 ++-- src/tcp/tcppinger.cpp | 2 +- src/tcp/tcpsegment.cpp | 2 +- 13 files changed, 22 insertions(+), 13 deletions(-) diff --git a/pclint.lnt b/pclint.lnt index cb8d458..21a34ca 100644 --- a/pclint.lnt +++ b/pclint.lnt @@ -3,6 +3,9 @@ // Hide "Location cited in prior message", emitted by BOOST_FOREACH -e830 +// Ignore return value of std::copy +-esym(534, std::copy) + // Set up include directories --isrc --ilib/boost-custom diff --git a/src/config/configuration.cpp b/src/config/configuration.cpp index 4cf3747..f29c4f6 100644 --- a/src/config/configuration.cpp +++ b/src/config/configuration.cpp @@ -58,7 +58,7 @@ bool Configuration::get_daemon() const } void Configuration::set_daemon( bool daemon ) -{ +{ //lint !e578 Daemon = daemon; } diff --git a/src/host/messagepayload.cpp b/src/host/messagepayload.cpp index 0048566..ea2f2ea 100644 --- a/src/host/messagepayload.cpp +++ b/src/host/messagepayload.cpp @@ -93,7 +93,7 @@ MessagePayload& MessagePayload::operator=( const MessagePayload &other ) BOOST_ASSERT( PayloadSizeInBytes == other.PayloadSizeInBytes ); - return *this; + return *this; //lint !e429 } /** @@ -124,7 +124,7 @@ uint8_t& MessagePayload::operator[]( size_t offset ) BOOST_ASSERT( offset < PayloadSizeInBytes ); return Payload[ offset ]; -} +} //lint !e1762 /** * @brief Get a pointer to the underlying array. diff --git a/src/host/pinger.cpp b/src/host/pinger.cpp index 0703a9b..9de6e80 100644 --- a/src/host/pinger.cpp +++ b/src/host/pinger.cpp @@ -50,5 +50,6 @@ Pinger::~Pinger() */ Pinger& Pinger::operator=( const Pinger & ) { + // TODO: Not implemented at all? Then disable it in the class definition return *this; } diff --git a/src/host/pingerfactory.cpp b/src/host/pingerfactory.cpp index 0171e03..3463923 100644 --- a/src/host/pingerfactory.cpp +++ b/src/host/pingerfactory.cpp @@ -97,8 +97,8 @@ shared_ptr PingerFactory::createPinger( new TcpPinger( io_serv, tcp_raw_protocol::v6(), network_interface, ping_reply_timeout_in_sec ) ); default: - BOOST_ASSERT( !"Try to create a pinger from an invalid protocol" ); - return shared_ptr(); + BOOST_ASSERT( !"Try to create a pinger from an invalid protocol" ); //lint !e506 + return shared_ptr(); //lint !e527 } } catch ( const system_error &ex ) @@ -109,5 +109,5 @@ shared_ptr PingerFactory::createPinger( exit( EXIT_FAILURE ); } - return shared_ptr(); + return shared_ptr(); //lint !527 } diff --git a/src/host/pingscheduler.cpp b/src/host/pingscheduler.cpp index 93bfb93..9f52a98 100644 --- a/src/host/pingscheduler.cpp +++ b/src/host/pingscheduler.cpp @@ -122,7 +122,7 @@ bool PingScheduler::start_pinging() setup_next_ping(); // event processing loop, it is a blocking call! - IoService.run(); + IoService.run(); //lint !e534 return true; } diff --git a/src/icmp/icmpmessage.cpp b/src/icmp/icmpmessage.cpp index b55af24..82e3079 100644 --- a/src/icmp/icmpmessage.cpp +++ b/src/icmp/icmpmessage.cpp @@ -36,6 +36,7 @@ IcmpMessage::~IcmpMessage() */ IcmpMessage& IcmpMessage::operator=( const IcmpMessage & ) { + // TODO: Not implemented at all. Fix it or disable it return *this; } diff --git a/src/icmp/icmppacket.cpp b/src/icmp/icmppacket.cpp index 8905454..4372765 100644 --- a/src/icmp/icmppacket.cpp +++ b/src/icmp/icmppacket.cpp @@ -50,5 +50,6 @@ IcmpPacket::~IcmpPacket() */ IcmpPacket& IcmpPacket::operator=( const IcmpPacket & ) { + // TODO: Not implemented at all. Fix it or disable it return *this; } diff --git a/src/icmp/icmppinger.cpp b/src/icmp/icmppinger.cpp index d2bb4db..f326385 100644 --- a/src/icmp/icmppinger.cpp +++ b/src/icmp/icmppinger.cpp @@ -262,7 +262,7 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred ) set_ping_status( PingStatus_SuccessReply ); - IcmpPacketReceiveTimer.cancel(); + IcmpPacketReceiveTimer.cancel(); //lint !e534 } else if ( icmp_packet->match_destination_unreachable( Identifier, SequenceNumber, @@ -274,7 +274,7 @@ void IcmpPinger::handle_receive_icmp_packet( const size_t &bytes_transferred ) set_ping_status( PingStatus_FailureDestinationUnreachable ); - IcmpPacketReceiveTimer.cancel(); + IcmpPacketReceiveTimer.cancel(); //lint !e534 } // Unknown ICMP reply, start another receive till timeout else diff --git a/src/icmp/icmpv6packet.cpp b/src/icmp/icmpv6packet.cpp index 71f0f6f..119d0e8 100644 --- a/src/icmp/icmpv6packet.cpp +++ b/src/icmp/icmpv6packet.cpp @@ -151,6 +151,9 @@ bool Icmpv6Packet::match( return ( type_match && identifier_match && seq_num_match && address_match ); #else + // Silence compiler warning + (void)source_address; + return ( type_match && identifier_match && seq_num_match ); #endif } diff --git a/src/link/linkstatusanalyzer.cpp b/src/link/linkstatusanalyzer.cpp index 78c6864..81e4880 100644 --- a/src/link/linkstatusanalyzer.cpp +++ b/src/link/linkstatusanalyzer.cpp @@ -100,7 +100,7 @@ void LinkStatusAnalyzer::notify_host_up( const string &host_address ) // removed from the list? BOOST_ASSERT( HostsDownList.count( host_address ) == 0 ); -} +} //lint !e1788 /** * @brief Notify the system that a given host is down. The object takes an @@ -127,7 +127,7 @@ void LinkStatusAnalyzer::notify_host_down( const string &host_address ) // inserted in the list? BOOST_ASSERT( HostsDownList.count( host_address ) == 1 ); -} +} //lint !e1788 void LinkStatusAnalyzer::add_host_up( const string &host_address ) { diff --git a/src/tcp/tcppinger.cpp b/src/tcp/tcppinger.cpp index 74499f9..cde82a6 100644 --- a/src/tcp/tcppinger.cpp +++ b/src/tcp/tcppinger.cpp @@ -294,7 +294,7 @@ void TcpPinger::handle_receive_tcp_segment( const size_t &bytes_transferred ) set_ping_status( PingStatus_SuccessReply ); - TcpSegmentReceiveTimer.cancel(); + TcpSegmentReceiveTimer.cancel(); //lint !e534 } // Unknown TCP reply, start another receive till timeout else diff --git a/src/tcp/tcpsegment.cpp b/src/tcp/tcpsegment.cpp index 97839b1..43790f3 100644 --- a/src/tcp/tcpsegment.cpp +++ b/src/tcp/tcpsegment.cpp @@ -50,6 +50,6 @@ TcpSegment::~TcpSegment() */ TcpSegment& TcpSegment::operator=( const TcpSegment & ) { + // TODO: Not implemented at all. Fix it or disable it. return *this; } - -- 1.7.1