cppcheck/cppcheck.spec
OBS User mrdocs 74717428cf 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 03:33:22 +00:00

117 lines
3.5 KiB
RPMSpec

#
# spec file for package cppcheck
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: cppcheck
Version: 1.82
Release: 0
Summary: A tool for static C/C++ code analysis
License: GPL-3.0+
Group: Development/Languages/C and C++
URL: http://cppcheck.sourceforge.net/
Source: https://downloads.sourceforge.net/cppcheck/cppcheck-%{version}.tar.bz2
BuildRequires: docbook-xsl-stylesheets
BuildRequires: gcc-c++
BuildRequires: pcre-devel
BuildRequires: python
BuildRequires: xsltproc
Requires: python
Requires: python-Pygments
Requires: python-xml
%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++
BuildRequires: pkgconfig
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5PrintSupport)
BuildRequires: pkgconfig(Qt5Widgets)
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
make %{?_smp_mflags} \
CXXFLAGS="-DNDEBUG %{optflags}" \
SRCDIR=build \
CFGDIR=%{_datadir}/%{name} \
HAVE_RULES=yes
pushd gui
%qmake5 \
QMAKE_CXXFLAGS="-DNDEBUG %{optflags}" \
HAVE_RULES=yes
%make_jobs
popd
make man \
DB2MAN=%{_datadir}/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl
%check
make %{?_smp_mflags} test \
CXXFLAGS="-DNDEBUG %{optflags}" \
HAVE_RULES=yes
%install
install -m 0755 -D cppcheck %{buildroot}%{_bindir}/cppcheck
install -m 0755 -D htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport
install -m 0755 -D gui/cppcheck-gui %{buildroot}%{_bindir}/cppcheck-gui
install -m 0644 -D cppcheck.1 %{buildroot}%{_mandir}/man1/cppcheck.1
install -d %{buildroot}%{_datadir}/%{name}
install -m 0644 cfg/*.cfg %{buildroot}%{_datadir}/%{name}
%files
%doc AUTHORS
%license COPYING
%{_bindir}/cppcheck
%{_bindir}/cppcheck-htmlreport
%{_datadir}/%{name}/
%{_mandir}/man1/cppcheck.1*
%files gui
%{_bindir}/cppcheck-gui
%changelog