[cppcheck/el4] Update to 1.50.

Jussi Lehtola jussilehtola at fedoraproject.org
Fri Aug 19 07:50:07 UTC 2011


commit 00a75ca529af71fa3baac7428aa487a5739c4378
Author: Jussi Lehtola <jussilehtola at fedoraproject.org>
Date:   Fri Aug 19 10:49:53 2011 +0300

    Update to 1.50.

 cppcheck-1.50-preprocessor.patch |   43 ++++++++++++++++++++++++++++++++++++++
 cppcheck.spec                    |   19 +++++++++++-----
 sources                          |    2 +-
 3 files changed, 57 insertions(+), 7 deletions(-)
---
diff --git a/cppcheck-1.50-preprocessor.patch b/cppcheck-1.50-preprocessor.patch
new file mode 100644
index 0000000..c993c0d
--- /dev/null
+++ b/cppcheck-1.50-preprocessor.patch
@@ -0,0 +1,43 @@
+diff -up cppcheck-1.50/lib/preprocessor.cpp.orig cppcheck-1.50/lib/preprocessor.cpp
+--- cppcheck-1.50/lib/preprocessor.cpp.orig	2011-08-14 10:45:53.000000000 +0300
++++ cppcheck-1.50/lib/preprocessor.cpp	2011-08-19 10:17:20.240800771 +0300
+@@ -1716,8 +1716,10 @@ std::string Preprocessor::getcode(const 
+             continue;
+         }
+ 
+-        std::string def = getdef(line, true);
+-        std::string ndef = getdef(line, false);
++        const std::string def = getdef(line, true);
++        const std::string ndef = getdef(line, false);
++
++        const bool emptymatch = matching_ifdef.empty() | matched_ifdef.empty();
+ 
+         if (line.compare(0, 8, "#define ") == 0)
+         {
+@@ -1742,7 +1744,7 @@ std::string Preprocessor::getcode(const 
+             }
+         }
+ 
+-        else if (line.compare(0, 7, "#elif !") == 0)
++        else if (!emptymatch && line.compare(0, 7, "#elif !") == 0)
+         {
+             if (matched_ifdef.back())
+             {
+@@ -1758,7 +1760,7 @@ std::string Preprocessor::getcode(const 
+             }
+         }
+ 
+-        else if (line.compare(0, 6, "#elif ") == 0)
++        else if (!emptymatch && line.compare(0, 6, "#elif ") == 0)
+         {
+             if (matched_ifdef.back())
+             {
+@@ -1786,7 +1788,7 @@ std::string Preprocessor::getcode(const 
+             matched_ifdef.push_back(matching_ifdef.back());
+         }
+ 
+-        else if (line == "#else")
++        else if (!emptymatch && line == "#else")
+         {
+             if (! matched_ifdef.empty())
+                 matching_ifdef.back() = ! matched_ifdef.back();
diff --git a/cppcheck.spec b/cppcheck.spec
index dbed694..c9f6b28 100644
--- a/cppcheck.spec
+++ b/cppcheck.spec
@@ -1,11 +1,13 @@
 Name:		cppcheck
-Version:	1.48
-Release:	2%{?dist}
+Version:	1.50
+Release:	1%{?dist}
 Summary:	A tool for static C/C++ code analysis
 Group:		Development/Languages
 License:	GPLv3+
 URL:		http://cppcheck.wiki.sourceforge.net/
 Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
+# Fix BZ #730580
+Patch0:		cppcheck-1.50-preprocessor.patch
 BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
 BuildRequires:	pcre-devel
@@ -24,22 +26,21 @@ various compiler extensions, inline assembly code, etc.
 
 %prep
 %setup -q
+%patch0 -p1
 
 # Make sure bundled tinyxml is not used
 rm -r externals/tinyxml
 
 %build
 # TINYXML= prevents use of bundled tinyxml
-make CXXFLAGS="%{optflags} -DNDEBUG -DHAVE_RULES" TINYXML= LDFLAGS=-ltinyxml \
-    %{?_smp_mflags}
+make CXXFLAGS="%{optflags} -DNDEBUG -DHAVE_RULES" TINYXML= LDFLAGS="-ltinyxml -lpcre" %{?_smp_mflags}
 
 %install
 rm -rf %{buildroot}
 install -D -p -m 755 cppcheck %{buildroot}%{_bindir}/cppcheck
 
 %check
-make CXXFLAGS="%{optflags} -DNDEBUG -DHAVE_RULES" TINYXML= LDFLAGS=-ltinyxml \
-    %{?_smp_mflags} check
+make CXXFLAGS="%{optflags} -DNDEBUG -DHAVE_RULES" TINYXML= LDFLAGS="-ltinyxml -lpcre" %{?_smp_mflags} check
 
 %clean
 rm -rf %{buildroot}
@@ -50,6 +51,12 @@ rm -rf %{buildroot}
 %{_bindir}/cppcheck
 
 %changelog
+* Sun Aug 14 2011 Jussi Lehtola <jussilehtola at fedoraproject.org> - 1.50-1
+- Update to 1.50.
+
+* Mon Jun 13 2011 Jussi Lehtola <jussilehtola at fedoraproject.org> - 1.49-1
+- Update to 1.49.
+
 * Sat Apr 30 2011 Ville Skyttä <ville.skytta at iki.fi> - 1.48-2
 - Build with system tinyxml and support for rules.
 - Run test suite during build, don't include its sources in docs.
diff --git a/sources b/sources
index 9e1e802..30393bd 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-64e09239da434f644ef785c9036d081a  cppcheck-1.48.tar.bz2
+79ef3898b246ba9c143155d5ad23dbd1  cppcheck-1.50.tar.bz2


More information about the scm-commits mailing list