Remove clang:find_bad_constructs suppression from logging (part 1).

This CL removes //build/config/clang:find_bad_constructs from the
suppressed_configs list, which means that clang:find_bad_constructs
is now enabled on these translation units.

Bug: webrtc:9251, webrtc:163
Change-Id: I443c0c77cef30a3f5712f72ce88db80d1fb29874
Reviewed-on: https://webrtc-review.googlesource.com/96642
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24567}
This commit is contained in:
Mirko Bonadei
2018-09-03 09:47:38 +02:00
committed by Commit Bot
parent b267b0e021
commit 55d5ef0048
11 changed files with 94 additions and 23 deletions

View File

@ -287,11 +287,6 @@ if (rtc_enable_protobuf) {
"../rtc_base:rtc_base_approved",
"//third_party/abseil-cpp/absl/memory",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
if (rtc_include_tests) {

View File

@ -236,6 +236,13 @@ void GetHeaderExtensions(std::vector<RtpExtension>* header_extensions,
} // namespace
ParsedRtcEventLog::ParsedRtcEventLog() = default;
ParsedRtcEventLog::~ParsedRtcEventLog() = default;
ParsedRtcEventLog::BweProbeResultEvent::BweProbeResultEvent() = default;
ParsedRtcEventLog::BweProbeResultEvent::BweProbeResultEvent(
const BweProbeResultEvent&) = default;
bool ParsedRtcEventLog::ParseFile(const std::string& filename) {
std::ifstream file(filename, std::ios_base::in | std::ios_base::binary);
if (!file.good() || !file.is_open()) {

View File

@ -46,6 +46,9 @@ class ParsedRtcEventLog {
friend class RtcEventLogTestHelper;
public:
ParsedRtcEventLog();
~ParsedRtcEventLog();
struct BweProbeClusterCreatedEvent {
uint64_t timestamp;
uint32_t id;
@ -55,6 +58,9 @@ class ParsedRtcEventLog {
};
struct BweProbeResultEvent {
BweProbeResultEvent();
BweProbeResultEvent(const BweProbeResultEvent&);
uint64_t timestamp;
uint32_t id;
absl::optional<uint64_t> bitrate_bps;

View File

@ -272,6 +272,60 @@ void GetHeaderExtensions(std::vector<RtpExtension>* header_extensions,
} // namespace
LoggedRtcpPacket::LoggedRtcpPacket(uint64_t timestamp_us,
const uint8_t* packet,
size_t total_length)
: timestamp_us(timestamp_us), raw_data(packet, packet + total_length) {}
LoggedRtcpPacket::LoggedRtcpPacket(const LoggedRtcpPacket& rhs) = default;
LoggedRtcpPacket::~LoggedRtcpPacket() = default;
LoggedVideoSendConfig::LoggedVideoSendConfig(
int64_t timestamp_us,
const std::vector<rtclog::StreamConfig>& configs)
: timestamp_us(timestamp_us), configs(configs) {}
LoggedVideoSendConfig::LoggedVideoSendConfig(const LoggedVideoSendConfig& rhs) =
default;
LoggedVideoSendConfig::~LoggedVideoSendConfig() = default;
ParsedRtcEventLogNew::~ParsedRtcEventLogNew() = default;
ParsedRtcEventLogNew::LoggedRtpStreamIncoming::LoggedRtpStreamIncoming() =
default;
ParsedRtcEventLogNew::LoggedRtpStreamIncoming::LoggedRtpStreamIncoming(
const LoggedRtpStreamIncoming& rhs) = default;
ParsedRtcEventLogNew::LoggedRtpStreamIncoming::~LoggedRtpStreamIncoming() =
default;
ParsedRtcEventLogNew::LoggedRtpStreamOutgoing::LoggedRtpStreamOutgoing() =
default;
ParsedRtcEventLogNew::LoggedRtpStreamOutgoing::LoggedRtpStreamOutgoing(
const LoggedRtpStreamOutgoing& rhs) = default;
ParsedRtcEventLogNew::LoggedRtpStreamOutgoing::~LoggedRtpStreamOutgoing() =
default;
ParsedRtcEventLogNew::LoggedRtpStreamView::LoggedRtpStreamView(
uint32_t ssrc,
const LoggedRtpPacketIncoming* ptr,
size_t num_elements)
: ssrc(ssrc),
packet_view(PacketView<const LoggedRtpPacket>::Create(
ptr,
num_elements,
offsetof(LoggedRtpPacketIncoming, rtp))) {}
ParsedRtcEventLogNew::LoggedRtpStreamView::LoggedRtpStreamView(
uint32_t ssrc,
const LoggedRtpPacketOutgoing* ptr,
size_t num_elements)
: ssrc(ssrc),
packet_view(PacketView<const LoggedRtpPacket>::Create(
ptr,
num_elements,
offsetof(LoggedRtpPacketOutgoing, rtp))) {}
ParsedRtcEventLogNew::LoggedRtpStreamView::LoggedRtpStreamView(
const LoggedRtpStreamView&) = default;
ParsedRtcEventLogNew::ParsedRtcEventLogNew(
UnconfiguredHeaderExtensions parse_unconfigured_header_extensions)
: parse_unconfigured_header_extensions_(

View File

@ -178,8 +178,9 @@ struct LoggedRtpPacketOutgoing {
struct LoggedRtcpPacket {
LoggedRtcpPacket(uint64_t timestamp_us,
const uint8_t* packet,
size_t total_length)
: timestamp_us(timestamp_us), raw_data(packet, packet + total_length) {}
size_t total_length);
LoggedRtcpPacket(const LoggedRtcpPacket&);
~LoggedRtcpPacket();
int64_t timestamp_us;
std::vector<uint8_t> raw_data;
int64_t log_time_us() const { return timestamp_us; }
@ -286,8 +287,9 @@ struct LoggedVideoRecvConfig {
struct LoggedVideoSendConfig {
LoggedVideoSendConfig(int64_t timestamp_us,
const std::vector<rtclog::StreamConfig> configs)
: timestamp_us(timestamp_us), configs(configs) {}
const std::vector<rtclog::StreamConfig>& configs);
LoggedVideoSendConfig(const LoggedVideoSendConfig&);
~LoggedVideoSendConfig();
int64_t timestamp_us;
std::vector<rtclog::StreamConfig> configs;
int64_t log_time_us() const { return timestamp_us; }
@ -470,6 +472,8 @@ class ParsedRtcEventLogNew {
friend class RtcEventLogTestHelper;
public:
~ParsedRtcEventLogNew();
enum class EventType {
UNKNOWN_EVENT = 0,
LOG_START = 1,
@ -499,11 +503,17 @@ class ParsedRtcEventLogNew {
};
struct LoggedRtpStreamIncoming {
LoggedRtpStreamIncoming();
LoggedRtpStreamIncoming(const LoggedRtpStreamIncoming&);
~LoggedRtpStreamIncoming();
uint32_t ssrc;
std::vector<LoggedRtpPacketIncoming> incoming_packets;
};
struct LoggedRtpStreamOutgoing {
LoggedRtpStreamOutgoing();
LoggedRtpStreamOutgoing(const LoggedRtpStreamOutgoing&);
~LoggedRtpStreamOutgoing();
uint32_t ssrc;
std::vector<LoggedRtpPacketOutgoing> outgoing_packets;
};
@ -511,20 +521,11 @@ class ParsedRtcEventLogNew {
struct LoggedRtpStreamView {
LoggedRtpStreamView(uint32_t ssrc,
const LoggedRtpPacketIncoming* ptr,
size_t num_elements)
: ssrc(ssrc),
packet_view(PacketView<const LoggedRtpPacket>::Create(
ptr,
num_elements,
offsetof(LoggedRtpPacketIncoming, rtp))) {}
size_t num_elements);
LoggedRtpStreamView(uint32_t ssrc,
const LoggedRtpPacketOutgoing* ptr,
size_t num_elements)
: ssrc(ssrc),
packet_view(PacketView<const LoggedRtpPacket>::Create(
ptr,
num_elements,
offsetof(LoggedRtpPacketOutgoing, rtp))) {}
size_t num_elements);
LoggedRtpStreamView(const LoggedRtpStreamView&);
uint32_t ssrc;
PacketView<const LoggedRtpPacket> packet_view;
};

View File

@ -46,8 +46,9 @@ constexpr size_t Nack::kNackItemLength;
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | PID | BLP |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Nack::Nack() {}
Nack::~Nack() {}
Nack::Nack() = default;
Nack::Nack(const Nack& rhs) = default;
Nack::~Nack() = default;
bool Nack::Parse(const CommonHeader& packet) {
RTC_DCHECK_EQ(packet.type(), kPacketType);

View File

@ -23,6 +23,7 @@ class Nack : public Rtpfb {
public:
static constexpr uint8_t kFeedbackMessageType = 1;
Nack();
Nack(const Nack&);
~Nack() override;
// Parse assumes header is already parsed and validated.

View File

@ -35,6 +35,8 @@ constexpr size_t ReceiverReport::kMaxNumberOfReportBlocks;
ReceiverReport::ReceiverReport() : sender_ssrc_(0) {}
ReceiverReport::ReceiverReport(const ReceiverReport& rhs) = default;
ReceiverReport::~ReceiverReport() = default;
bool ReceiverReport::Parse(const CommonHeader& packet) {

View File

@ -26,6 +26,7 @@ class ReceiverReport : public RtcpPacket {
static constexpr size_t kMaxNumberOfReportBlocks = 0x1f;
ReceiverReport();
ReceiverReport(const ReceiverReport&);
~ReceiverReport() override;
// Parse assumes header is already parsed and validated.

View File

@ -41,6 +41,8 @@ constexpr uint8_t Remb::kFeedbackMessageType;
Remb::Remb() : bitrate_bps_(0) {}
Remb::Remb(const Remb& rhs) = default;
Remb::~Remb() = default;
bool Remb::Parse(const CommonHeader& packet) {

View File

@ -26,6 +26,7 @@ class Remb : public Psfb {
static constexpr size_t kMaxNumberOfSsrcs = 0xff;
Remb();
Remb(const Remb&);
~Remb() override;
// Parse assumes header is already parsed and validated.