Compare commits
22 Commits
Author | SHA1 | Date |
---|---|---|
Steve Grubb | dc3a190b2f | |
Steve Grubb | 2fd9c1984d | |
Fedora Release Engineering | b16bda44e7 | |
Steve Grubb | 1f301daa60 | |
Rich Mattes | c2a89aefa3 | |
Wolfgang Stöggl | c375328a31 | |
Fedora Release Engineering | 411869e6e3 | |
Wolfgang Stöggl | 69bb397641 | |
Wolfgang Stöggl | cbf882a9c7 | |
Jerry James | 84ec457e0a | |
Wolfgang Stöggl | 055678f7d2 | |
Wolfgang Stöggl | bc53bd0890 | |
Wolfgang Stöggl | ef547dcd11 | |
Wolfgang Stöggl | 9e60ef3b47 | |
Wolfgang Stöggl | 84bdb32ee3 | |
Fedora Release Engineering | d2128a85bc | |
Wolfgang Stöggl | c0747da1f3 | |
Wolfgang Stöggl | 6f85fa2223 | |
Fedora Release Engineering | e2c1dbb34c | |
Fedora Release Engineering | 9fe67b5a23 | |
Wolfgang Stöggl | 82d93b85ab | |
Tomas Hrnciar | 259fc737cb |
|
@ -45,3 +45,11 @@ cppcheck-1.44.tar.bz2
|
|||
/cppcheck-2.1.tar.gz
|
||||
/cppcheck-2.2.tar.gz
|
||||
/cppcheck-2.3.tar.gz
|
||||
/cppcheck-2.5.tar.gz
|
||||
/cppcheck-2.6.tar.gz
|
||||
/cppcheck-2.7.tar.gz
|
||||
/cppcheck-2.7.3.tar.gz
|
||||
/cppcheck-2.7.4.tar.gz
|
||||
/cppcheck-2.8.tar.gz
|
||||
/cppcheck-2.8.2.tar.gz
|
||||
/cppcheck-2.9.tar.gz
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
From 5c4dc7f32978243db8ea10153b3cd84d116a1d10 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Fultz II <pfultz2@yahoo.com>
|
||||
Date: Mon, 14 Dec 2020 04:13:47 -0600
|
||||
Subject: [PATCH] Fix issue 10024: FP: nullPointerRedundantCheck when using a
|
||||
goto statement (#2947)
|
||||
|
||||
(cherry picked from commit da1375c9a3f3a3b7eae7aece5e2ba03e59973aa0)
|
||||
---
|
||||
lib/reverseanalyzer.cpp | 2 ++
|
||||
test/testnullpointer.cpp | 18 ++++++++++++++++++
|
||||
2 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/lib/reverseanalyzer.cpp b/lib/reverseanalyzer.cpp
|
||||
index a6a86f63e..31deda58d 100644
|
||||
--- a/lib/reverseanalyzer.cpp
|
||||
+++ b/lib/reverseanalyzer.cpp
|
||||
@@ -124,6 +124,8 @@ struct ReverseTraversal {
|
||||
}
|
||||
if (Token::Match(tok, "return|break|continue"))
|
||||
break;
|
||||
+ if (Token::Match(tok, "%name% :"))
|
||||
+ break;
|
||||
// Evaluate LHS of assignment before RHS
|
||||
if (Token* assignTok = assignExpr(tok)) {
|
||||
Token* assignTop = assignTok;
|
||||
diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp
|
||||
index 94d772911..8a3738fe9 100644
|
||||
--- a/test/testnullpointer.cpp
|
||||
+++ b/test/testnullpointer.cpp
|
||||
@@ -106,6 +106,7 @@ private:
|
||||
TEST_CASE(nullpointer63);
|
||||
TEST_CASE(nullpointer64);
|
||||
TEST_CASE(nullpointer65); // #9980
|
||||
+ TEST_CASE(nullpointer66); // #10024
|
||||
TEST_CASE(nullpointer_addressOf); // address of
|
||||
TEST_CASE(nullpointerSwitch); // #2626
|
||||
TEST_CASE(nullpointer_cast); // #4692
|
||||
@@ -2032,6 +2033,23 @@ private:
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
+ void nullpointer66() {
|
||||
+ check("int f() {\n"
|
||||
+ " int ret = 0;\n"
|
||||
+ " int *v = nullptr;\n"
|
||||
+ " if (!MyAlloc(&v)) {\n"
|
||||
+ " ret = -1;\n"
|
||||
+ " goto done;\n"
|
||||
+ " }\n"
|
||||
+ " DoSomething(*v);\n"
|
||||
+ "done:\n"
|
||||
+ " if (v)\n"
|
||||
+ " MyFree(&v);\n"
|
||||
+ " return ret;\n"
|
||||
+ "}\n");
|
||||
+ ASSERT_EQUALS("", errout.str());
|
||||
+ }
|
||||
+
|
||||
void nullpointer_addressOf() { // address of
|
||||
check("void f() {\n"
|
||||
" struct X *x = 0;\n"
|
||||
--
|
||||
2.29.2
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
diff --git a/lib/programmemory.cpp b/lib/programmemory.cpp
|
||||
index 753a5c846..bb9569624 100644
|
||||
--- a/lib/programmemory.cpp
|
||||
+++ b/lib/programmemory.cpp
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "symboldatabase.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
+#include <limits>
|
||||
#include <memory>
|
||||
|
||||
void ProgramMemory::setValue(nonneg int varid, const ValueFlow::Value &value)
|
||||
diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp
|
||||
index 1d2bc8d54..399ea7593 100644
|
||||
--- a/test/testsymboldatabase.cpp
|
||||
+++ b/test/testsymboldatabase.cpp
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
+#include <limits>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <set>
|
|
@ -1,22 +1,17 @@
|
|||
%undefine __cmake_in_source_build
|
||||
|
||||
Name: cppcheck
|
||||
Version: 2.3
|
||||
Release: 3%{?dist}
|
||||
Version: 2.9
|
||||
Release: 4%{?dist}
|
||||
Summary: Tool for static C/C++ code analysis
|
||||
License: GPLv3+
|
||||
License: GPL-3.0
|
||||
URL: http://cppcheck.wiki.sourceforge.net/
|
||||
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
|
||||
Source0: https://github.com/danmar/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
|
||||
# Fix location of translations
|
||||
Patch0: cppcheck-2.2-translations.patch
|
||||
# Select python3 explicitly
|
||||
Patch1: cppcheck-1.88-htmlreport-python3.patch
|
||||
# Fix for missing #include with gcc-11
|
||||
Patch2: cppcheck-2.3-gcc11.patch
|
||||
# da1375c9a3f3 ("Fix issue 10024: FP: nullPointerRedundantCheck
|
||||
# when using a goto statement (#2947)")
|
||||
Patch3: cppcheck-2.3-Fix-issue-10024-FP-nullPointerRedundantCheck-when-us.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: pcre-devel
|
||||
|
@ -28,7 +23,7 @@ BuildRequires: desktop-file-utils
|
|||
BuildRequires: tinyxml2-devel >= 2.1.0
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: z3-devel >= 4.7.1
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: qt5-qtbase-devel
|
||||
BuildRequires: qt5-qttools-devel
|
||||
BuildRequires: qt5-linguist
|
||||
|
@ -62,8 +57,6 @@ from xml files first generated using cppcheck.
|
|||
%setup -q
|
||||
%patch0 -p1 -b .translations
|
||||
%patch1 -p1 -b .python3
|
||||
%patch2 -p1 -b .gcc11
|
||||
%patch3 -p1 -b .nullptrcheck
|
||||
# Make sure bundled tinyxml2 is not used
|
||||
rm -r externals/tinyxml2
|
||||
# Generate the Qt online-help file
|
||||
|
@ -78,7 +71,7 @@ pandoc man/reference-cfg-format.md -o man/reference-cfg-format.html -s --number-
|
|||
|
||||
# Binaries
|
||||
# Upstream doesn't support shared libraries (unversioned solib)
|
||||
%cmake -DCMAKE_BUILD_TYPE=Release -DUSE_MATCHCOMPILER=yes -DUSE_Z3=yes -DHAVE_RULES=yes -DBUILD_GUI=1 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=yes -DFILESDIR=%{_datadir}/Cppcheck -DUSE_BUNDLED_TINYXML2=OFF -DENABLE_OSS_FUZZ=OFF
|
||||
%cmake -DCMAKE_BUILD_TYPE=Release -DUSE_MATCHCOMPILER=yes -DHAVE_RULES=yes -DBUILD_GUI=1 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=yes -DFILESDIR=%{_datadir}/Cppcheck -DUSE_BUNDLED_TINYXML2=OFF -DENABLE_OSS_FUZZ=OFF
|
||||
%cmake_build
|
||||
|
||||
%install
|
||||
|
@ -92,9 +85,10 @@ install -D -p -m 644 gui/cppcheck-gui.png %{buildroot}%{_datadir}/pixmaps/cppche
|
|||
# Install the Qt online-help file
|
||||
install -D -p -m 644 gui/help/online-help.qhc %{buildroot}%{_datadir}/Cppcheck/help/online-help.qhc
|
||||
install -D -p -m 644 gui/help/online-help.qch %{buildroot}%{_datadir}/Cppcheck/help/online-help.qch
|
||||
|
||||
# Install htmlreport
|
||||
install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport
|
||||
# Restore execute permission of python files
|
||||
grep -l "#\!/usr/bin/env python3" %{buildroot}%{_datadir}/Cppcheck/addons/*.py | xargs chmod +x
|
||||
|
||||
%check
|
||||
cd %{_vpath_builddir}/bin
|
||||
|
@ -118,6 +112,57 @@ cd %{_vpath_builddir}/bin
|
|||
%{_bindir}/cppcheck-htmlreport
|
||||
|
||||
%changelog
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.9-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Fri Jan 13 2023 Steve Grubb <sgrubb@redhat.com> - 2.9-3
|
||||
- SPDX Migration
|
||||
|
||||
* Sun Sep 25 2022 Rich Mattes <richmattes@gmail.com> - 2.9-2
|
||||
- Rebuild for tinyxml2-9.0.0
|
||||
|
||||
* Sun Aug 28 2022 Wolfgang Stöggl <c72578@yahoo.de> - 2.9-1
|
||||
- Update to 2.9
|
||||
|
||||
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Sat Jul 16 2022 Wolfgang Stöggl <c72578@yahoo.de> - 2.8.2-1
|
||||
- Update to 2.8.2
|
||||
|
||||
* Wed May 25 2022 Wolfgang Stöggl <c72578@yahoo.de> - 2.8-1
|
||||
- Update to 2.8
|
||||
|
||||
* Thu May 19 2022 Jerry James <loganjerry@gmail.com> - 2.7.4-2
|
||||
- Rebuild for z3 4.8.17
|
||||
|
||||
* Fri Mar 25 2022 Wolfgang Stöggl <c72578@yahoo.de> - 2.7.4-1
|
||||
- Update to 2.7.4
|
||||
|
||||
* Wed Mar 23 2022 Wolfgang Stöggl <c72578@yahoo.de> - 2.7.3-2
|
||||
- Update tinyxml2 patch, add upstream link and rebuild
|
||||
|
||||
* Sat Mar 19 2022 Wolfgang Stöggl <c72578@yahoo.de> - 2.7.3-1
|
||||
- Update to 2.7.3.
|
||||
|
||||
* Tue Feb 08 2022 Wolfgang Stöggl <c72578@yahoo.de> - 2.7-1
|
||||
- Update to 2.7.
|
||||
|
||||
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Sat Oct 02 2021 Wolfgang Stöggl <c72578@yahoo.de> - 2.6-1
|
||||
- Update to 2.6.
|
||||
|
||||
* Fri Jul 23 2021 Wolfgang Stöggl <c72578@yahoo.de> - 2.5-3
|
||||
- Fix Failed to load translation for English (#1983599)
|
||||
|
||||
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Sun Jul 04 2021 Wolfgang Stöggl <c72578@yahoo.de> - 2.5-1
|
||||
- Update to 2.5.
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.3-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
|
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (cppcheck-2.3.tar.gz) = ee15890f77c58847d4add7d555398e4bb83e3a73e942f218413b9830f05b2c975b49bf0aeb0092e0467f0cd7f26b9f05013f701dd80ee5e2aa3d2ef81945c4ed
|
||||
SHA512 (cppcheck-2.9.tar.gz) = 69204a7ceac087470201482894e6422b99d0849f08641e80b2e341c9d164a1d2095e3a08a1fba2e9fa681783d07fe7277b30ea0cc0bf582431b5d13ab2f58c1f
|
||||
|
|
Loading…
Reference in New Issue