SHA256
1
0
forked from pool/cppcheck
cppcheck/cppcheck.spec

119 lines
3.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package cppcheck
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: cppcheck
Version: 1.90
Release: 0
Summary: A tool for static C/C++ code analysis
License: GPL-3.0-or-later
Group: Development/Languages/C and C++
Accepting request 577725 from home:alois:branches:devel:tools - Update to version 1.82 Bug fixes: * Better handling of namespaces * Fixed false positives * Fixed parsing of compile databases * Fixed parsing of visual studio projects Enhancements * New check; Detect mistakes when there are multiple strcmp() in condition Example: if (strcmp(password,"A")==0 || strcmp(password,"B")==0 || strcmp(password,"C")) There is a missing '==0', and therefore this condition is always true except when password is "C". * New check; pointer calculation result can't be NULL unless there is overflow Example: someType **list_p = ...; if ((list_p + 1) == NULL) The result for '(list_p + 1)' can't be NULL unless there is overflow (UB). * New check; public interface of classes should be safe - detect possible division by zero Example: class Fred { public: void setValue(int mul, int div) { value = mul / div; // <- unsafe } ... This check does not consider how Fred::setValue() is really called. If you agree that the public interface of classes should always be safe; it should be allowed to call all public methods with arbitrary arguments, then this checker will be useful. * Fixed a few false negatives * More information in the cfg files version 1.81 CPPCHECK: * New warning: Check if condition after an early return is overlapping and therefore always false. * Improved knowledge about C/C++ standard, windows, posix, wxwidgets, gnu * Better handling of Visual Studio projects GUI: * Compile: Qt5 is now needed to build the GUI * Compile: New qmake flag HAVE_QCHART * Project: You can now run cppcheck-addons * Project: We have integrated clang-tidy * Results view: Reload last results (if cppcheck build dir is used) when GUI is started * Results view: Tag the warnings with custom keywords (bug/todo/not important/etc..) * Results view: Shows when warning first appeared (since date) * Results view: Suppress warnings through right-click menu * Statistics: Added charts (shown if Qt charts module is enabled during build) version 1.80 Checking improvements: * Added platform for Atmel AVR 8 bit microcontrollers (avr8) * Better 'callstacks' in cppcheck messages * Improved gnu.cfg, posix.cfg, wxwidgets.cfg and std.cfg, added motif.cfg * Various improvements to AST, ValueFlow analysis and template parsing Command line changes: * Deprecated command line argument *-append has been removed * New command line argument *-plist-output to create .plist files * New command line argument *-output-file to print output to file directly * Check OpenCL files (.cl) GUI: * Support export of statistics to PDF * Several small usability improvements * Additionally, lots of false positives and bugs have been fixed and several existing checks have been improved. version 1.79 General changes: * C++ code in C files is rejected now (use *-language=c++ to enforce checking the code as C++) * Write function access type to XML dump Checking improvements: * Improved configuration extraction in preprocessor * Improved accuracy of AST * Improved template parsing * Improved support for (STL) containers in SymbolDatabase * Improved support for C++11's 'auto' type * Experimental support for uninitialized variables in ValueFlow analysis * Added qt.cfg and sfml.cfg, improved several existing .cfg files GUI: * Use CFGDIR macro * Additionally, lots of false positives and bugs have been fixed and several existing checks have been improved. version 1.78 General changes: * Reduced memory usage by up to 10% by reducing size of token list New checks: * Mismatching argument names between function declaration and definition * Detect classes which have a copy constructor but no copy operator and vice versa Checking improvements: * Improved matching of overloaded functions * Improved ValueType analysis, especially related to allocations with "new" and C++11's "auto" * Improved support for C++11 brace initialization * Improved ValueFlow analysis * Improved template parsing * Improved detection of memory leaks * Improved nullpointer checking when nullptr and NULL are used * Detect array out of bounds across compilation units * Extended windows.cfg, posix.cfg and std.cfg * Additionally, lots of false positives and bugs have been fixed and several existing checks have been improved. OBS-URL: https://build.opensuse.org/request/show/577725 OBS-URL: https://build.opensuse.org/package/show/devel:tools/cppcheck?expand=0&rev=51
2018-02-19 04:33:22 +01:00
URL: http://cppcheck.sourceforge.net/
Source: https://downloads.sourceforge.net/cppcheck/cppcheck-%{version}.tar.bz2
BuildRequires: cmake
BuildRequires: docbook-xsl-stylesheets
BuildRequires: gcc-c++
BuildRequires: libqt5-linguist-devel
BuildRequires: pkgconfig
BuildRequires: python3-base
BuildRequires: xsltproc
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5PrintSupport)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(libpcre)
Requires: python3-Pygments
%description
This program tries to detect bugs that your C/C++ compiler don't see. Cppcheck
is versatile. You can check non-standard code that includes various compiler
extensions, inline assembly code, etc. Checking covers for example these
errors:
* Out of bounds
* Uninitialized member variable 'classname::varname'
* Using 'memfunc' on class
* Using 'memfunc' on struct that contains a 'std::classname'
* Class Base which is inherited by class Derived does not have a virtual
destructor
* Memory leak: varname
* Resource leak: varname
* Deallocating a deallocated pointer: varname
* Using 'varname' after it is deallocated / released
* Invalid radix in call to strtol or strtoul. Must be 0 or 2-36
* Overlapping data buffer varname
* Unsigned division. The result will be wrong.
* Unusual pointer arithmetic
%package gui
Summary: A tool for static C/C++ code analysis
Group: Development/Languages/C and C++
Requires: cppcheck
%description gui
This is the gui for Cppcheck, a program to detect bugs that your C/C++ compiler
doesn't see.
%prep
%setup -q
%build
%cmake \
-DCMAKE_CXX_FLAGS="-DNDEBUG %{optflags} -UCFGDIR -DCFGDIR=\\\"%{_datadir}/%{name}\\\"" \
-DBUILD_GUI=ON \
-DBUILD_TESTS=ON \
-DHAVE_RULES=yes
%cmake_build
# does not work with CMake, directly call provided Makefile from source directory
cd ..
%make_build man \
DB2MAN=%{_datadir}/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl
# use python3 as interpreter
sed -i "s|env python|python3|g" htmlreport/cppcheck-htmlreport
%check
export CXXFLAGS="%{optflags}"
%ctest
%install
install -Dpm 0755 build/bin/cppcheck \
%{buildroot}%{_bindir}/cppcheck
install -Dpm 0755 htmlreport/cppcheck-htmlreport \
%{buildroot}%{_bindir}/cppcheck-htmlreport
install -Dpm 0755 build/bin/cppcheck-gui \
%{buildroot}%{_bindir}/cppcheck-gui
install -Dpm 0644 cppcheck.1 \
%{buildroot}%{_mandir}/man1/cppcheck.1
install -d %{buildroot}%{_datadir}/%{name}
install -pm 0644 cfg/*.cfg %{buildroot}%{_datadir}/%{name}
%files
Accepting request 577725 from home:alois:branches:devel:tools - Update to version 1.82 Bug fixes: * Better handling of namespaces * Fixed false positives * Fixed parsing of compile databases * Fixed parsing of visual studio projects Enhancements * New check; Detect mistakes when there are multiple strcmp() in condition Example: if (strcmp(password,"A")==0 || strcmp(password,"B")==0 || strcmp(password,"C")) There is a missing '==0', and therefore this condition is always true except when password is "C". * New check; pointer calculation result can't be NULL unless there is overflow Example: someType **list_p = ...; if ((list_p + 1) == NULL) The result for '(list_p + 1)' can't be NULL unless there is overflow (UB). * New check; public interface of classes should be safe - detect possible division by zero Example: class Fred { public: void setValue(int mul, int div) { value = mul / div; // <- unsafe } ... This check does not consider how Fred::setValue() is really called. If you agree that the public interface of classes should always be safe; it should be allowed to call all public methods with arbitrary arguments, then this checker will be useful. * Fixed a few false negatives * More information in the cfg files version 1.81 CPPCHECK: * New warning: Check if condition after an early return is overlapping and therefore always false. * Improved knowledge about C/C++ standard, windows, posix, wxwidgets, gnu * Better handling of Visual Studio projects GUI: * Compile: Qt5 is now needed to build the GUI * Compile: New qmake flag HAVE_QCHART * Project: You can now run cppcheck-addons * Project: We have integrated clang-tidy * Results view: Reload last results (if cppcheck build dir is used) when GUI is started * Results view: Tag the warnings with custom keywords (bug/todo/not important/etc..) * Results view: Shows when warning first appeared (since date) * Results view: Suppress warnings through right-click menu * Statistics: Added charts (shown if Qt charts module is enabled during build) version 1.80 Checking improvements: * Added platform for Atmel AVR 8 bit microcontrollers (avr8) * Better 'callstacks' in cppcheck messages * Improved gnu.cfg, posix.cfg, wxwidgets.cfg and std.cfg, added motif.cfg * Various improvements to AST, ValueFlow analysis and template parsing Command line changes: * Deprecated command line argument *-append has been removed * New command line argument *-plist-output to create .plist files * New command line argument *-output-file to print output to file directly * Check OpenCL files (.cl) GUI: * Support export of statistics to PDF * Several small usability improvements * Additionally, lots of false positives and bugs have been fixed and several existing checks have been improved. version 1.79 General changes: * C++ code in C files is rejected now (use *-language=c++ to enforce checking the code as C++) * Write function access type to XML dump Checking improvements: * Improved configuration extraction in preprocessor * Improved accuracy of AST * Improved template parsing * Improved support for (STL) containers in SymbolDatabase * Improved support for C++11's 'auto' type * Experimental support for uninitialized variables in ValueFlow analysis * Added qt.cfg and sfml.cfg, improved several existing .cfg files GUI: * Use CFGDIR macro * Additionally, lots of false positives and bugs have been fixed and several existing checks have been improved. version 1.78 General changes: * Reduced memory usage by up to 10% by reducing size of token list New checks: * Mismatching argument names between function declaration and definition * Detect classes which have a copy constructor but no copy operator and vice versa Checking improvements: * Improved matching of overloaded functions * Improved ValueType analysis, especially related to allocations with "new" and C++11's "auto" * Improved support for C++11 brace initialization * Improved ValueFlow analysis * Improved template parsing * Improved detection of memory leaks * Improved nullpointer checking when nullptr and NULL are used * Detect array out of bounds across compilation units * Extended windows.cfg, posix.cfg and std.cfg * Additionally, lots of false positives and bugs have been fixed and several existing checks have been improved. OBS-URL: https://build.opensuse.org/request/show/577725 OBS-URL: https://build.opensuse.org/package/show/devel:tools/cppcheck?expand=0&rev=51
2018-02-19 04:33:22 +01:00
%doc AUTHORS
%license COPYING
%{_bindir}/cppcheck
%{_bindir}/cppcheck-htmlreport
%{_datadir}/%{name}/
%{_mandir}/man1/cppcheck.1%{?ext_man}
%files gui
%{_bindir}/cppcheck-gui
%changelog