Skip to content

Commit f49b152

Browse files
committed
issue: 2945718 Fix gcc12 compilation issue
C++17 has deprecated a few components that had been in C++ since its beginning, and std::iterator is one of them. In addition fixed configure warning: checking mellanox/dpcp.h presence... no configure: WARNING: mellanox/dpcp.h: accepted by the compiler, rejected by the preprocessor! configure: WARNING: mellanox/dpcp.h: proceeding with the compiler's result The reason: preprocessor does not see -std=c++11 Signed-off-by: Igor Ivanov <[email protected]>
1 parent 4b7ffbb commit f49b152

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

config/m4/dpcp.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ AS_IF([test "x$with_dpcp" == xno],
4343
vma_cv_dpcp_LDFLAGS="-L$with_dpcp/lib64 -Wl,--rpath,$with_dpcp/lib64"
4444
fi
4545
46-
CPPFLAGS="$vma_cv_dpcp_CPPFLAGS $CPPFLAGS"
46+
CPPFLAGS="-std=c++11 $vma_cv_dpcp_CPPFLAGS $CPPFLAGS"
4747
CXXFLAGS="-std=c++11 $CXXFLAGS"
4848
LDFLAGS="$vma_cv_dpcp_LDFLAGS $LDFLAGS"
4949
LIBS="$vma_cv_dpcp_LIBS $LIBS"

src/vma/util/vma_list.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,14 @@ public :
8888

8989
template<typename T, size_t offset(void)>
9090
/* coverity[missing_move_assignment] */
91-
class list_iterator_t : public std::iterator<std::random_access_iterator_tag, T, std::ptrdiff_t, T*, T&>
91+
class list_iterator_t
9292
{
9393
public:
94+
using iterator_category = std::random_access_iterator_tag;
95+
using value_type = T;
96+
using difference_type = std::ptrdiff_t;
97+
using pointer = T*;
98+
using reference = T&;
9499

95100
list_iterator_t(T* ptr = NULL) : m_ptr(ptr) {}
96101

0 commit comments

Comments
 (0)