forked from pool/cppcheck
6b3188e605
- Add GCC compatibility fixes: * 0001-Fix-gcc11-build-errors.patch * 0002-Another-gcc11-fix-3179.patch OBS-URL: https://build.opensuse.org/request/show/896626 OBS-URL: https://build.opensuse.org/package/show/devel:tools/cppcheck?expand=0&rev=79
44 lines
1.8 KiB
Diff
44 lines
1.8 KiB
Diff
From 1203306c3e76212a73794c9744b974a1a22e0c23 Mon Sep 17 00:00:00 2001
|
||
From: =?UTF-8?q?Tomasz=20K=C5=82oczko?=
|
||
<31284574+kloczek@users.noreply.github.com>
|
||
Date: Mon, 22 Mar 2021 17:43:08 +0000
|
||
Subject: [PATCH 1/2] Another gcc11 fix (#3179)
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: 8bit
|
||
|
||
/home/tkloczko/rpmbuild/BUILD/cppcheck-2.4/lib/symboldatabase.cpp: In member function ‘void SymbolDatabase::createSymbolDatabaseExprIds()’:
|
||
/home/tkloczko/rpmbuild/BUILD/cppcheck-2.4/lib/symboldatabase.cpp:1443:32: error: ‘numeric_limits’ is not a member of ‘std’
|
||
1443 | if (id == std::numeric_limits<nonneg int>::max()) {
|
||
| ^~~~~~~~~~~~~~
|
||
/home/tkloczko/rpmbuild/BUILD/cppcheck-2.4/lib/symboldatabase.cpp:1443:54: error: expected primary-expression before ‘int’
|
||
1443 | if (id == std::numeric_limits<nonneg int>::max()) {
|
||
| ^~~
|
||
/home/tkloczko/rpmbuild/BUILD/cppcheck-2.4/lib/symboldatabase.cpp:1443:47: error: expected ‘)’ before ‘int’
|
||
1443 | if (id == std::numeric_limits<nonneg int>::max()) {
|
||
| ~ ^ ~~~
|
||
| )
|
||
|
||
This patch adds missing `include #include <limits>`
|
||
|
||
Co-authored-by: Your Name <you@example.com>
|
||
---
|
||
lib/symboldatabase.cpp | 1 +
|
||
1 file changed, 1 insertion(+)
|
||
|
||
diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp
|
||
index d597892..3604d51 100644
|
||
--- a/lib/symboldatabase.cpp
|
||
+++ b/lib/symboldatabase.cpp
|
||
@@ -35,6 +35,7 @@
|
||
#include <cassert>
|
||
#include <climits>
|
||
#include <cstring>
|
||
+#include <limits>
|
||
#include <iomanip>
|
||
#include <iostream>
|
||
#include <unordered_map>
|
||
--
|
||
2.31.1
|
||
|