Fix compilation issues observed on gcc 11.0.0-0.17+

Signed-off-by: Igor Ivanov <igor.ivanov.va@gmail.com>
This commit is contained in:
Igor Ivanov 2021-02-02 12:03:06 +00:00
parent 9e22ff02e8
commit 4636fdd1a5

View File

@ -1,4 +1,4 @@
From 3178430b32c71c0348eb33521d8323122714a58b Mon Sep 17 00:00:00 2001
From d64a8e295ad39032790501955e3bdb7d86e8b05f Mon Sep 17 00:00:00 2001
From: Igor Ivanov <igor.ivanov.va@gmail.com>
Date: Wed, 16 Dec 2020 13:46:17 +0200
Subject: [PATCH] Fix issues for gcc-11
@ -6,14 +6,16 @@ Subject: [PATCH] Fix issues for gcc-11
1. The register storage class specifier is deprecated in C++11
2. Disable -Wno-free-nonheap-object diagnostic that looks as
incorrect for gcc-11
3. [-Werror=stringop-overread] in std::string()
Signed-off-by: Igor Ivanov <igor.ivanov.va@gmail.com>
---
configure.ac | 8 ++++++--
src/utils/asm-x86.h | 2 +-
src/vma/dev/net_device_val.cpp | 6 +++---
src/vma/sock/cleanable_obj.h | 9 ++++++++-
src/vma/util/utils.cpp | 4 ++--
4 files changed, 17 insertions(+), 6 deletions(-)
5 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1540324a..811eb421 100644
@ -47,6 +49,37 @@ index 5dfb6f42..4e8f03ca 100644
// ReaD Time Stamp Counter (RDTCS)
__asm__ __volatile__("rdtsc" : "=a" (lower_32), "=d" (upper_32));
diff --git a/src/vma/dev/net_device_val.cpp b/src/vma/dev/net_device_val.cpp
index 0e48a9e4..989e4539 100644
--- a/src/vma/dev/net_device_val.cpp
+++ b/src/vma/dev/net_device_val.cpp
@@ -962,7 +962,7 @@ void net_device_val::update_netvsc_slaves(int if_index, int if_flags)
std::string net_device_val::to_str()
{
- return std::string("Net Device: " + m_name);
+ return std::string("Net Device: ") + m_name;
}
ring* net_device_val::reserve_ring(resource_allocation_key *key)
@@ -1414,7 +1414,7 @@ void net_device_val_eth::create_br_address(const char* ifname)
}
std::string net_device_val_eth::to_str()
{
- return std::string("ETH: " + net_device_val::to_str());
+ return std::string("ETH: ") + net_device_val::to_str();
}
net_device_val_ib::~net_device_val_ib()
@@ -1512,7 +1512,7 @@ void net_device_val_ib::create_br_address(const char* ifname)
std::string net_device_val_ib::to_str()
{
- return std::string("IB: " + net_device_val::to_str());
+ return std::string("IB: ") + net_device_val::to_str();
}
diff --git a/src/vma/sock/cleanable_obj.h b/src/vma/sock/cleanable_obj.h
index 34801712..ea38f24b 100644
--- a/src/vma/sock/cleanable_obj.h