Skip to content

Commit e10c4ca

Browse files
committed
provide proper barebones compiler defines based on GCC 10.2.1 (the Debian bullseye compiler) for selfcheck and daca / removed unnecessary checks for __CPPCHECK__ [skip ci]
1 parent 3747685 commit e10c4ca

File tree

9 files changed

+17
-21
lines changed

9 files changed

+17
-21
lines changed

.github/workflows/CI-unixish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ jobs:
623623
624624
- name: Self check
625625
run: |
626-
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,information --exception-handling --debug-warnings --check-level=exhaustive"
626+
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,information --exception-handling --debug-warnings --check-level=exhaustive"
627627
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
628628
gui_options="-DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt"
629629
ec=0

.github/workflows/asan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
- name: Self check
143143
if: false
144144
run: |
145-
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,information --exception-handling --debug-warnings --check-level=exhaustive"
145+
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,information --exception-handling --debug-warnings --check-level=exhaustive"
146146
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
147147
gui_options="-DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt"
148148
gui_options="$gui_options --suppress=autoNoType:*/moc_*.cpp --suppress=symbolDatabaseWarning:*/moc_*.cpp"

.github/workflows/selfcheck.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
- name: Self check (unusedFunction)
8080
if: false # TODO: fails with preprocessorErrorDirective - see #10667
8181
run: |
82-
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
82+
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
8383
env:
8484
DISABLE_VALUEFLOW: 1
8585
UNUSEDFUNCTION_ONLY: 1
@@ -103,7 +103,7 @@ jobs:
103103
104104
- name: Self check (unusedFunction / no test)
105105
run: |
106-
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
106+
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
107107
env:
108108
DISABLE_VALUEFLOW: 1
109109
UNUSEDFUNCTION_ONLY: 1
@@ -145,7 +145,7 @@ jobs:
145145
- name: Self check (unusedFunction / no test / no cli)
146146
if: false # TODO: the findings are currently too intrusive
147147
run: |
148-
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nocli/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
148+
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nocli/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
149149
env:
150150
DISABLE_VALUEFLOW: 1
151151
UNUSEDFUNCTION_ONLY: 1
@@ -164,7 +164,7 @@ jobs:
164164
- name: Self check (unusedFunction / no test / no cli / no gui)
165165
if: false # TODO: the findings are currently too intrusive
166166
run: |
167-
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nocli_nogui/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
167+
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nocli_nogui/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr
168168
env:
169169
DISABLE_VALUEFLOW: 1
170170
UNUSEDFUNCTION_ONLY: 1

.github/workflows/tsan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
- name: Self check
144144
if: false
145145
run: |
146-
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=0 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,information --exception-handling --debug-warnings --check-level=exhaustive"
146+
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ --error-exitcode=0 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,information --exception-handling --debug-warnings --check-level=exhaustive"
147147
selfcheck_options="$selfcheck_options --executor=thread"
148148
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
149149
gui_options="-DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt"

.github/workflows/ubsan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
# TODO: only fail the step on sanitizer issues - since we use processes it will only fail the underlying process which will result in an cppcheckError
138138
- name: Self check
139139
run: |
140-
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,information --exception-handling --debug-warnings --check-level=exhaustive"
140+
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,information --exception-handling --debug-warnings --check-level=exhaustive"
141141
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
142142
gui_options="-DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt"
143143
gui_options="$gui_options --suppress=autoNoType:*/moc_*.cpp --suppress=symbolDatabaseWarning:*/moc_*.cpp"

createrelease

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#
2828
# self check, fix critical issues:
2929
# make clean && make CXXOPTS=-O2 MATCHCOMPILER=yes -j4
30-
# ./cppcheck -D__CPPCHECK__ -D__GNUC__ -DCHECK_INTERNAL -DHAVE_RULES --std=c++11 --library=cppcheck-lib --library=qt --enable=style --inconclusive --inline-suppr --suppress=bitwiseOnBoolean --suppress=shadowFunction --suppress=useStlAlgorithm --suppress=*:externals/picojson.h --suppress=functionConst --suppress=functionStatic --suppress=normalCheckLevelMaxBranches --xml cli gui/*.cpp lib 2> selfcheck.xml
30+
# ./cppcheck -D__CPPCHECK__ -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ -DCHECK_INTERNAL -DHAVE_RULES --std=c++11 --library=cppcheck-lib --library=qt --enable=style --inconclusive --inline-suppr --suppress=bitwiseOnBoolean --suppress=shadowFunction --suppress=useStlAlgorithm --suppress=*:externals/picojson.h --suppress=functionConst --suppress=functionStatic --suppress=normalCheckLevelMaxBranches --xml cli gui/*.cpp lib 2> selfcheck.xml
3131
#
3232
# Generate lib/checkers.cpp (TODO the premium checkers should not be statically coded)
3333
# cd ~/cppchecksolutions/cppcheck && python3 tools/get_checkers.py > lib/checkers.cpp

lib/config.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
// C++11 noexcept
6262
#if defined(__cpp_noexcept_function_type) || \
6363
(defined(__GNUC__) && (__GNUC__ >= 5)) \
64-
|| defined(__clang__) \
65-
|| defined(__CPPCHECK__)
64+
|| defined(__clang__)
6665
# define NOEXCEPT noexcept
6766
#else
6867
# define NOEXCEPT
@@ -71,8 +70,7 @@
7170
// C++11 noreturn
7271
#if __has_cpp_attribute (noreturn) \
7372
|| (defined(__GNUC__) && (__GNUC__ >= 5)) \
74-
|| defined(__clang__) \
75-
|| defined(__CPPCHECK__)
73+
|| defined(__clang__)
7674
# define NORETURN [[noreturn]]
7775
#elif defined(__GNUC__)
7876
# define NORETURN __attribute__((noreturn))
@@ -95,8 +93,7 @@
9593
#if __cplusplus >= 201703L && __has_cpp_attribute (maybe_unused)
9694
# define UNUSED [[maybe_unused]]
9795
#elif defined(__GNUC__) \
98-
|| defined(__clang__) \
99-
|| defined(__CPPCHECK__)
96+
|| defined(__clang__)
10097
# define UNUSED __attribute__((unused))
10198
#else
10299
# define UNUSED
@@ -112,8 +109,7 @@
112109

113110
// deprecated
114111
#if defined(__GNUC__) \
115-
|| defined(__clang__) \
116-
|| defined(__CPPCHECK__)
112+
|| defined(__clang__)
117113
# define DEPRECATED __attribute__((deprecated))
118114
#elif defined(_MSC_VER)
119115
# define DEPRECATED __declspec(deprecated)
@@ -160,7 +156,7 @@
160156
#if defined(_WIN32)
161157
#define HAS_THREADING_MODEL_THREAD
162158
#define STDCALL __stdcall
163-
#elif ((defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)) || defined(__CPPCHECK__)
159+
#elif ((defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__))
164160
#define HAS_THREADING_MODEL_FORK
165161
#if !defined(DISALLOW_THREAD_EXECUTOR)
166162
#define HAS_THREADING_MODEL_THREAD

lib/path.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ std::string Path::getAbsoluteFilePath(const std::string& filePath)
380380
absolute_path = absolute;
381381
if (!absolute_path.empty() && absolute_path.back() == '\\')
382382
absolute_path.pop_back();
383-
#elif defined(__linux__) || defined(__sun) || defined(__hpux) || defined(__GNUC__) || defined(__CPPCHECK__)
383+
#elif defined(__linux__) || defined(__sun) || defined(__hpux) || defined(__GNUC__)
384384
// simplify the path since any non-existent part has to exist even if discarded by ".."
385385
std::string spath = Path::simplifyPath(filePath);
386386
char * absolute = realpath(spath.c_str(), nullptr);

tools/donate_cpu_lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
1717
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
1818
# changes)
19-
CLIENT_VERSION = "1.3.69"
19+
CLIENT_VERSION = "1.3.70"
2020

2121
# Timeout for analysis with Cppcheck in seconds
2222
CPPCHECK_TIMEOUT = 30 * 60
@@ -458,7 +458,7 @@ def scan_package(cppcheck_path, source_path, libraries, capture_callstack=True,
458458
if debug_warnings:
459459
options += ' --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout' \
460460
' --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning --suppress=normalCheckLevelConditionExpressions'
461-
options += ' -D__GNUC__ --platform=unix64'
461+
options += ' -D__GNUC__=10 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__linux__ -D__gnu_linux__ -D__x86_64__ -D__STDC__ --platform=unix64'
462462
options_rp = options + ' -rp={}'.format(dir_to_scan)
463463
if __make_cmd == 'msbuild.exe':
464464
cppcheck_cmd = os.path.join(cppcheck_path, 'bin', 'cppcheck.exe') + ' ' + options_rp

0 commit comments

Comments
 (0)