Update to 1.51.

This commit is contained in:
Jussi Lehtola 2011-10-09 14:40:40 +03:00
parent 7ac0fbff00
commit 62ed767735
3 changed files with 16 additions and 48 deletions

View File

@ -1,43 +0,0 @@
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();

View File

@ -1,13 +1,11 @@
Name: cppcheck
Version: 1.50
Version: 1.51
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
@ -26,21 +24,28 @@ 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
%if 0%{?rhel} == 4
make CXXFLAGS="%{optflags} -I%{_includedir}/pcre -DNDEBUG -DHAVE_RULES" TINYXML= LDFLAGS="-ltinyxml -lpcre" %{?_smp_mflags}
%else
make CXXFLAGS="%{optflags} -DNDEBUG -DHAVE_RULES" TINYXML= LDFLAGS="-ltinyxml -lpcre" %{?_smp_mflags}
%endif
%install
rm -rf %{buildroot}
install -D -p -m 755 cppcheck %{buildroot}%{_bindir}/cppcheck
%check
%if 0%{?rhel} == 4
make CXXFLAGS="%{optflags} -I%{_includedir}/pcre -DNDEBUG -DHAVE_RULES" TINYXML= LDFLAGS="-ltinyxml -lpcre" %{?_smp_mflags} check
%else
make CXXFLAGS="%{optflags} -DNDEBUG -DHAVE_RULES" TINYXML= LDFLAGS="-ltinyxml -lpcre" %{?_smp_mflags} check
%endif
%clean
rm -rf %{buildroot}
@ -51,6 +56,12 @@ rm -rf %{buildroot}
%{_bindir}/cppcheck
%changelog
* Sun Oct 09 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.51-1
- Update to 1.51.
* Fri Aug 19 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.50-2
- Fix build on EPEL-4.
* Sun Aug 14 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.50-1
- Update to 1.50.

View File

@ -1 +1 @@
79ef3898b246ba9c143155d5ad23dbd1 cppcheck-1.50.tar.bz2
8349ab90472801b9d377cfabf846ca28 cppcheck-1.51.tar.bz2