Skip to content

Commit 7002179

Browse files
Merge branch 'main' into chr_15016
2 parents 6b12ec5 + c83bee7 commit 7002179

405 files changed

Lines changed: 16676 additions & 1707 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.selfcheck_suppressions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ functionStatic:externals/tinyxml2/tinyxml2.cpp
7575
funcArgNamesDifferent:externals/tinyxml2/tinyxml2.cpp
7676
funcArgNamesDifferentUnnamed:externals/tinyxml2/tinyxml2.cpp
7777
funcArgNamesDifferentUnnamed:externals/tinyxml2/tinyxml2.h
78-
nullPointerRedundantCheck:externals/tinyxml2/tinyxml2.cpp
7978
knownConditionTrueFalse:externals/tinyxml2/tinyxml2.cpp
79+
nullPointerRedundantCheck:externals/tinyxml2/tinyxml2.cpp
8080
useStlAlgorithm:externals/simplecpp/simplecpp.cpp
8181
funcArgNamesDifferentUnnamed:externals/simplecpp/simplecpp.h
8282
missingMemberCopy:externals/simplecpp/simplecpp.h

AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ Cilyan Olowen
9797
Claus Jensby Madsen
9898
Colomban Wendling
9999
Conrado Gouvea
100+
correctmost
100101
daisuke-chiba
101102
Daniel Friedrich
102103
David Korczynski
103104
Daniel Marjamäki
104105
Daschle Newberry
105106
David Hallas
106107
David Korth
108+
David Ramnerö
107109
Dávid Slivka
108110
Debrard Sebastien
109111
Deepak Gupta
@@ -196,6 +198,7 @@ Jeewoong Kim
196198
Jens Bäckman
197199
Jens Yllman
198200
Jérémy Lefaure
201+
Jérôme Duval
199202
Jes Ramsing
200203
Jesse Boswell
201204
Jim Kuhn

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.22)
2-
project(Cppcheck VERSION 2.21.99 LANGUAGES CXX)
2+
project(Cppcheck VERSION 2.22.99 LANGUAGES CXX)
33

44
include(cmake/options.cmake)
55

cfg/gnu.cfg

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,16 +241,94 @@
241241
<function name="__builtin_trap,__builtin_unreachable">
242242
<noreturn>true</noreturn>
243243
</function>
244+
<!-- https://gcc.gnu.org/onlinedocs/gcc/Bit-Operation-Builtins.html -->
244245
<!-- int __builtin_popcount (unsigned int x) -->
246+
<!-- int __builtin_popcountl (unsigned long x) -->
247+
<!-- int __builtin_popcountll (unsigned long long x) -->
245248
<!-- int __builtin_parity (unsigned int x) -->
249+
<!-- int __builtin_parityl (unsigned long x) -->
250+
<!-- int __builtin_parityll (unsigned long long x) -->
246251
<!-- int __builtin_ffs (int x) -->
247-
<!-- int __builtin_ffsl (long) -->
248-
<!-- int __builtin_ffsll (long long) -->
252+
<!-- int __builtin_ffsl (long x) -->
253+
<!-- int __builtin_ffsll (long long x) -->
254+
<!-- int __builtin_clrsb (int x) -->
255+
<!-- int __builtin_clrsbl (long x) -->
256+
<!-- int __builtin_clrsbll (long long x) -->
257+
<function name="__builtin_popcount,__builtin_popcountl,__builtin_popcountll,__builtin_parity,__builtin_parityl,__builtin_parityll,__builtin_ffs,__builtin_ffsl,__builtin_ffsll,__builtin_clrsb,__builtin_clrsbl,__builtin_clrsbll">
258+
<noreturn>false</noreturn>
259+
<returnValue type="int"/>
260+
<use-retval/>
261+
<const/>
262+
<arg nr="1" direction="in">
263+
<not-uninit/>
264+
<not-bool/>
265+
</arg>
266+
</function>
249267
<!-- int __builtin_clz (unsigned int x) -->
250-
<function name="__builtin_popcount,__builtin_parity,__builtin_ffs,__builtin_ffsl,__builtin_ffsll,__builtin_clz">
268+
<!-- int __builtin_clzl (unsigned long x) -->
269+
<!-- int __builtin_clzll (unsigned long long x) -->
270+
<!-- int __builtin_ctz (unsigned int x) -->
271+
<!-- int __builtin_ctzl (unsigned long x) -->
272+
<!-- int __builtin_ctzll (unsigned long long x) -->
273+
<function name="__builtin_clz,__builtin_clzl,__builtin_clzll,__builtin_ctz,__builtin_ctzl,__builtin_ctzll">
251274
<noreturn>false</noreturn>
252275
<returnValue type="int"/>
253276
<use-retval/>
277+
<const/>
278+
<arg nr="1" direction="in">
279+
<not-uninit/>
280+
<not-bool/>
281+
<!-- result is undefined if x is 0 -->
282+
<valid>1:</valid>
283+
</arg>
284+
</function>
285+
<!-- int __builtin_ffsg (...) -->
286+
<!-- int __builtin_clrsbg (...) -->
287+
<!-- int __builtin_popcountg (...) -->
288+
<!-- int __builtin_parityg (...) -->
289+
<function name="__builtin_ffsg,__builtin_clrsbg,__builtin_popcountg,__builtin_parityg">
290+
<noreturn>false</noreturn>
291+
<returnValue type="int"/>
292+
<use-retval/>
293+
<const/>
294+
<arg nr="1" direction="in">
295+
<not-uninit/>
296+
<not-bool/>
297+
</arg>
298+
</function>
299+
<!-- int __builtin_clzg (...) -->
300+
<!-- int __builtin_ctzg (...) -->
301+
<function name="__builtin_clzg,__builtin_ctzg">
302+
<noreturn>false</noreturn>
303+
<returnValue type="int"/>
304+
<use-retval/>
305+
<const/>
306+
<arg nr="1" direction="in">
307+
<not-uninit/>
308+
<not-bool/>
309+
</arg>
310+
<arg nr="variadic" direction="in">
311+
<not-uninit/>
312+
<not-bool/>
313+
</arg>
314+
</function>
315+
<!-- unsigned int __builtin_stdc_bit_width (uintX_t x) -->
316+
<!-- unsigned int __builtin_stdc_count_ones (uintX_t x) -->
317+
<!-- unsigned int __builtin_stdc_count_zeros (uintX_t x) -->
318+
<!-- unsigned int __builtin_stdc_first_leading_one (uintX_t x) -->
319+
<!-- unsigned int __builtin_stdc_first_leading_zero (uintX_t x) -->
320+
<!-- unsigned int __builtin_stdc_first_trailing_one (uintX_t x) -->
321+
<!-- unsigned int __builtin_stdc_first_trailing_zero (uintX_t x) -->
322+
<!-- unsigned int __builtin_stdc_leading_ones (uintX_t x) -->
323+
<!-- unsigned int __builtin_stdc_leading_zeros (uintX_t x) -->
324+
<!-- unsigned int __builtin_stdc_trailing_ones (uintX_t x) -->
325+
<!-- unsigned int __builtin_stdc_trailing_zeros (uintX_t x) -->
326+
<!-- unsigned int __builtin_stdc_has_single_bit (uintX_t x) -->
327+
<function name="__builtin_stdc_bit_width,__builtin_stdc_count_ones,__builtin_stdc_count_zeros,__builtin_stdc_first_leading_one,__builtin_stdc_first_leading_zero,__builtin_stdc_first_trailing_one,__builtin_stdc_first_trailing_zero,__builtin_stdc_leading_ones,__builtin_stdc_leading_zeros,__builtin_stdc_trailing_ones,__builtin_stdc_trailing_zeros,__builtin_stdc_has_single_bit">
328+
<noreturn>false</noreturn>
329+
<returnValue type="unsigned int"/>
330+
<use-retval/>
331+
<const/>
254332
<arg nr="1" direction="in">
255333
<not-uninit/>
256334
<not-bool/>

cli/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
*
2222
* @mainpage Cppcheck
23-
* @version 2.21.99
23+
* @version 2.22.99
2424
*
2525
* @section overview_sec Overview
2626
* Cppcheck is a simple tool for static analysis of C/C++ code.

createrelease

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
# Review trac roadmap, are tickets closed properly?
99
# Only tickets that should be retargeted should be open.
1010
#
11+
# Execute this script to check if trac tickets can be closed
12+
# tools/release-trac-fixed-open-tickets.py
13+
#
1114
# Versioning scheme
1215
# ========================
1316
# VERSION=2.22.0 # the new release tag created
@@ -23,14 +26,12 @@
2326
# cd ~/cppchecksolutions/addon/coverage
2427
# CPPCHECK_REPO=~/cppchecksolutions/cppcheck python3 coverage.py --code
2528
#
26-
# Check every isPremiumEnabled call: TODO write helper script
27-
# - every id should be in --errorlist
28-
# git grep 'isPremiumEnabled[(]"' | sed 's/.*isPremiumEnabled[(]"//' | sed 's/".*//' | sort | uniq > ids1.txt
29-
# ./cppcheck --errorlist | grep ' id="' | sed 's/.* id="//' | sed 's/".*//' | sort | uniq > ids2.txt
30-
# diff -y ids1.txt ids2.txt
31-
# - premiumaddon: check coverage.py
32-
# python3 coverage.py --id ; sort ids-*.txt | uniq > ~/cppcheck/ids3.txt
33-
# diff -y ids2.txt ids3.txt
29+
# Check that every premium check id is a real, known Cppcheck error id: every
30+
# id passed to isPremiumEnabled(...) and every id referenced by the premium
31+
# addon's MISRA/CERT/AUTOSAR/CWE coverage mapping (coverage.py) must show up
32+
# in `cppcheck --errorlist`, otherwise the id was renamed/removed and the
33+
# premium check or compliance mapping is silently broken.
34+
# tools/release-check-premium-ids.py
3435
#
3536
# Windows installer:
3637
# - ensure latest build was successful
@@ -44,7 +45,7 @@
4445
# cd ~/cppchecksolutions/cppcheck && python3 tools/get_checkers.py > lib/checkers.cpp
4546
#
4647
# Update copyright year: TODO release script
47-
# git diff $PREV -- */*.cpp */*.h | grep '^diff --git a/' | sed 's|.* b/||' | xargs sed -i "s/Copyright (C) 2007-20[12]./Copyright (C) 2007-$(date +%Y)/"
48+
# git grep -l 'Copyright (C) 2007-20' -- '*.cpp' '*.h' '*.py' | while read f; do y=$(git log -1 --format=%ad --date=format:%Y --invert-grep -i --grep=copyright -- "$f"); sed -i "s/Copyright (C) 2007-20[0-9][0-9]/Copyright (C) 2007-$y/" "$f"; done
4849
# git diff | grep '^diff --git a/'
4950
#
5051
# Make sure "cppcheck --errorlist" works:
@@ -131,11 +132,11 @@
131132
# 2. scp -i ~/.ssh/osuosl_id_rsa tools/donate-cpu-server.py danielmarjamaki@cppcheck1.osuosl.org:/var/daca@home/
132133
#
133134
# Backup:
134-
# * trac: cd /var && nice tar -cJf ~/trac.tar.xz trac-cppcheck/db/trac.db
135-
# * daca: cd /var && nice tar -cJf ~/daca.tar.xz daca@home
135+
# * trac: rm -f trac.db trac.tar.xz && cp /var/trac-cppcheck/db/trac.db . && nice tar -cJf trac.tar.xz trac.db
136+
# * daca: rm -rf daca@home daca.tar.xz && cp -R /var/daca@home . && nice tar -cJf daca.tar.xz daca@home
136137
# * git: git checkout -f && git checkout main && git pull && tar -cJf git.tar.xz .git
137138
# * git log $PREV..$VERSION > Changelog
138-
# * mkdir out && python3 ~/cppchecksolutions/release/getWorkflowAndIssueLogs.py -r /cppcheck-opensource//cppcheck -t $VERSION -p out
139+
# * cd ~/cppcheck && mkdir -p out && python3 ~/cppchecksolutions/release/getWorkflowAndIssueLogs.py -r cppcheck-opensource/cppcheck -t $VERSION -p out
139140

140141
# Folder/tag to use:
141142
tag=$1

gui/application.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2023 Cppcheck team.
3+
* Copyright (C) 2007-2022 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

gui/applicationdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Cppcheck - A tool for static C/C++ code analysis
3-
* Copyright (C) 2007-2023 Cppcheck team.
3+
* Copyright (C) 2007-2026 Cppcheck team.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)