diff --git a/.clang-tidy b/.clang-tidy index 7617f792e..7088c1b7a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -44,7 +44,9 @@ Checks: > -modernize-raw-string-literal, -modernize-replace-auto-ptr, -modernize-return-braced-init-list, + -modernize-type-traits, -modernize-use-auto, + -modernize-use-nodiscard, -modernize-use-trailing-return-type, -performance-avoid-endl, -performance-inefficient-string-concatenation, diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index c8095c54a..d6489f191 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -20,6 +20,10 @@ jobs: strategy: matrix: image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.04"] + include: + - build_gui: false + - image: "ubuntu:23.04" + build_gui: true fail-fast: false # Prefer quick result runs-on: ubuntu-22.04 @@ -48,11 +52,10 @@ jobs: apt-get update apt-get install -y cmake g++ make libxml2-utils libpcre3-dev - # required so a default Qt installation is configured - - name: Install missing software on ubuntu 18.04 - if: false # matrix.os == 'ubuntu-18.04' + - name: Install missing software on ubuntu 23.04 + if: matrix.build_gui run: | - sudo apt-get install qt5-default + apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev # needs to be called after the package installation since # - it doesn't call "apt-get update" @@ -82,13 +85,19 @@ jobs: cmake --build . -- -j$(nproc) - name: CMake build - if: matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04' + if: ${{ !matrix.build_gui && matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04' }} run: | mkdir cmake.output cd cmake.output cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. cmake --build . -- -j$(nproc) + - name: CMake build (with GUI) + if: matrix.build_gui + run: | + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake --build cmake.output -- -j$(nproc) + - name: Run CMake test if: matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04' run: | diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index c5f29ff73..d21e71d23 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -20,6 +20,10 @@ jobs: strategy: matrix: os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12] + include: + - use_qt6: On + - os: ubuntu-20.04 + use_qt6: Off fail-fast: false # Prefer quick result runs-on: ${{ matrix.os }} @@ -37,28 +41,36 @@ jobs: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} - name: Install missing software on ubuntu - if: contains(matrix.os, 'ubuntu') + if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'Off' run: | sudo apt-get update sudo apt-get install libxml2-utils libtinyxml2-dev qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser + - name: Install missing software on ubuntu + if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On' + run: | + sudo apt-get update + # qt6-tools-dev-tools for lprodump + # qt6-l10n-tools for lupdate + sudo apt-get install libxml2-utils libtinyxml2-dev qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev + # coreutils contains "nproc" - name: Install missing software on macos if: contains(matrix.os, 'macos') run: | # pcre was removed from runner images in November 2022 - brew install coreutils qt@5 tinyxml2 pcre + brew install coreutils qt@6 tinyxml2 pcre - name: CMake build on ubuntu (with GUI / system tinyxml2) if: contains(matrix.os, 'ubuntu') run: | - cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=${{ matrix.use_qt6 }} -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache cmake --build cmake.output.tinyxml2 -- -j$(nproc) - name: CMake build on macos (with GUI / system tinyxml2) if: contains(matrix.os, 'macos') run: | - cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 + cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 cmake --build cmake.output.tinyxml2 -- -j$(nproc) - name: Run CMake test (system tinyxml2) @@ -70,6 +82,10 @@ jobs: strategy: matrix: os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12] + include: + - use_qt6: On + - os: ubuntu-20.04 + use_qt6: Off fail-fast: false # Prefer quick result runs-on: ${{ matrix.os }} @@ -87,7 +103,7 @@ jobs: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} - name: Install missing software on ubuntu - if: contains(matrix.os, 'ubuntu') + if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'Off' run: | sudo apt-get update sudo apt-get install libxml2-utils qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser @@ -106,23 +122,31 @@ jobs: run: | echo "CXX=g++-13" >> $GITHUB_ENV + - name: Install missing software on ubuntu + if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On' + run: | + sudo apt-get update + # qt6-tools-dev-tools for lprodump + # qt6-l10n-tools for lupdate + sudo apt-get install libxml2-utils qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev + # coreutils contains "nproc" - name: Install missing software on macos if: contains(matrix.os, 'macos') run: | # pcre was removed from runner images in November 2022 - brew install coreutils qt@5 pcre + brew install coreutils qt@6 pcre - name: CMake build on ubuntu (with GUI) if: contains(matrix.os, 'ubuntu') run: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=${{ matrix.use_qt6 }} -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache cmake --build cmake.output -- -j$(nproc) - name: CMake build on macos (with GUI) if: contains(matrix.os, 'macos') run: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 cmake --build cmake.output -- -j$(nproc) - name: Run CMake test @@ -452,6 +476,7 @@ jobs: # compile with verification and ast matchers make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2 -w -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1 + # TODO: update to Qt6 - name: Generate UI files run: | pushd gui diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml index be203c093..56bf24998 100644 --- a/.github/workflows/CI-windows.yml +++ b/.github/workflows/CI-windows.yml @@ -28,7 +28,7 @@ jobs: strategy: matrix: os: [windows-2019, windows-2022] - qt_ver: [5.15.2, 6.2.4, 6.5.0] + qt_ver: [5.15.2, 6.2.4, 6.5.3] fail-fast: false runs-on: ${{ matrix.os }} @@ -67,7 +67,7 @@ jobs: - name: Build GUI release (CMake) if: startsWith(matrix.qt_ver, '6') run: | - cmake -S . -B build -DBUILD_GUI=On -DWITH_QCHART=On -DUSE_QT6=On || exit /b !errorlevel! + cmake -S . -B build -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On || exit /b !errorlevel! cmake --build build --target cppcheck-gui || exit /b !errorlevel! # TODO: deploy with CMake/Qt6 diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml index 13c838c33..d0a1c29c3 100644 --- a/.github/workflows/asan.yml +++ b/.github/workflows/asan.yml @@ -95,7 +95,7 @@ jobs: ec=0 ./cmake.output/bin/cppcheck $selfcheck_options externals/simplecpp || ec=1 ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json cli lib || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 exit $ec diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 3eda19549..5d50459a0 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 env: - QT_VERSION: 5.15.2 + QT_VERSION: 6.5.3 steps: - uses: actions/checkout@v3 @@ -53,7 +53,7 @@ jobs: - name: Prepare CMake run: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off env: CC: clang-17 CXX: clang++-17 diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index abba6f32b..6dfd0b707 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -57,6 +57,7 @@ jobs: ln -s iwyu_tool.py /usr/bin/iwyu_tool ln -s qt5 /usr/include/qt + # TODO: switch to Qt 6 after we enabled the Qt mappings again - name: Prepare CMake run: | cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off diff --git a/.github/workflows/selfcheck.yml b/.github/workflows/selfcheck.yml index 70cc147c4..efaceb367 100644 --- a/.github/workflows/selfcheck.yml +++ b/.github/workflows/selfcheck.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 env: - QT_VERSION: 5.15.2 + QT_VERSION: 6.5.3 steps: - uses: actions/checkout@v3 @@ -60,7 +60,7 @@ jobs: - name: CMake run: | - cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=ON -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On + cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On - name: Generate dependencies run: | @@ -75,7 +75,7 @@ jobs: - name: Self check (unusedFunction) if: false # TODO: fails with preprocessorErrorDirective - see #10667 run: | - ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --enable=unusedFunction --exception-handling -rp=. --project=cmake.output/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr + ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --enable=unusedFunction --exception-handling -rp=. --project=cmake.output/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr env: DISABLE_VALUEFLOW: 1 UNUSEDFUNCTION_ONLY: 1 @@ -83,7 +83,7 @@ jobs: # the following steps are duplicated from above since setting up the build node in a parallel step takes longer than the actual steps - name: CMake (no test) run: | - cmake -S . -B cmake.output.notest -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On + cmake -S . -B cmake.output.notest -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On - name: Generate dependencies (no test) run: | @@ -96,7 +96,7 @@ jobs: # TODO: find a way to report unmatched suppressions without need to add information checks - name: Self check (unusedFunction / no test) run: | - ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.notest/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr + ./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib --library=qt -D__CPPCHECK__ -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.notest/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr env: DISABLE_VALUEFLOW: 1 UNUSEDFUNCTION_ONLY: 1 @@ -108,7 +108,7 @@ jobs: - name: CMake (corpus / no test) run: | - cmake -S cppcheck-2.8 -B cmake.output.corpus -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On + cmake -S cppcheck-2.8 -B cmake.output.corpus -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On - name: Generate dependencies (corpus) run: | @@ -122,7 +122,7 @@ jobs: - name: Self check (unusedFunction / corpus / no test / callgrind) run: | # TODO: fix -rp so the suppressions actually work - valgrind --tool=callgrind ./cppcheck --template=selfcheck --error-exitcode=0 --library=cppcheck-lib --library=qt -D__GNUC__ -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.corpus/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr 2>callgrind.log || (cat callgrind.log && false) + valgrind --tool=callgrind ./cppcheck --template=selfcheck --error-exitcode=0 --library=cppcheck-lib --library=qt -D__GNUC__ -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --enable=unusedFunction --exception-handling -rp=. --project=cmake.output.corpus/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr 2>callgrind.log || (cat callgrind.log && false) cat callgrind.log callgrind_annotate --auto=no > callgrind.annotated.log head -50 callgrind.annotated.log diff --git a/.github/workflows/tsan.yml b/.github/workflows/tsan.yml index c841da9c3..fdb17dae7 100644 --- a/.github/workflows/tsan.yml +++ b/.github/workflows/tsan.yml @@ -94,7 +94,7 @@ jobs: ec=0 ./cmake.output/bin/cppcheck $selfcheck_options externals/simplecpp || ec=1 ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json -DCHECK_INTERNAL cli lib || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 exit $ec diff --git a/.github/workflows/ubsan.yml b/.github/workflows/ubsan.yml index 8596f3009..654448987 100644 --- a/.github/workflows/ubsan.yml +++ b/.github/workflows/ubsan.yml @@ -91,7 +91,7 @@ jobs: ec=0 ./cmake.output/bin/cppcheck $selfcheck_options externals/simplecpp || ec=1 ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options --addon=naming.json cli lib || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Icmake.output/gui -Igui gui/*.cpp cmake.output/gui/*.cpp || ec=1 ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -Icli test/*.cpp tools/*.cpp || ec=1 - ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 + ./cmake.output/bin/cppcheck $selfcheck_options $cppcheck_options -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB --library=qt -Icmake.output/tools/triage -Igui tools/triage/*.cpp cmake.output/tools/triage/*.cpp || ec=1 exit $ec diff --git a/clang-tidy.md b/clang-tidy.md index ba7c7d611..4bc5c5954 100644 --- a/clang-tidy.md +++ b/clang-tidy.md @@ -155,6 +155,11 @@ To be evaluated (need to remove exclusion). To be evaluated (need to enable explicitly). +`modernize-type-traits`
+`modernize-use-nodiscard`
+ +These apply to codebases which use later standards then C++11 (C++17 is used when building with Qt6) so we cannot simply apply them. + `portability-std-allocator-const`
Only necessary for code which is exclusively compiled with `libc++`. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132. diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index 90b7c137e..5cab7009e 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -24,6 +24,7 @@ if (BUILD_GUI) set(DISABLE_CRTDBG_MAP_ALLOC ON) endif() else() + message(WARNING "Building with Qt5 is deprecated (it went EOL in May 2023) and will be removed in a future release - please use Qt6 instead") find_package(Qt5 COMPONENTS ${qt_components} REQUIRED) set(QT_VERSION "${Qt5Core_VERSION_STRING}") endif() diff --git a/gui/codeeditorstyle.cpp b/gui/codeeditorstyle.cpp index 509a9570b..8ec1b1345 100644 --- a/gui/codeeditorstyle.cpp +++ b/gui/codeeditorstyle.cpp @@ -43,21 +43,21 @@ CodeEditorStyle::CodeEditorStyle( QColor SymbFGColor, QColor SymbBGColor, // cppcheck-suppress naming-varname - TODO: fix this QFont::Weight SymbWeight) : - widgetFGColor(std::move(CtrlFGColor)), - widgetBGColor(std::move(CtrlBGColor)), - highlightBGColor(std::move(HiLiBGColor)), - lineNumFGColor(std::move(LnNumFGColor)), - lineNumBGColor(std::move(LnNumBGColor)), - keywordColor(std::move(KeyWdFGColor)), + widgetFGColor(CtrlFGColor), + widgetBGColor(CtrlBGColor), + highlightBGColor(HiLiBGColor), + lineNumFGColor(LnNumFGColor), + lineNumBGColor(LnNumBGColor), + keywordColor(KeyWdFGColor), keywordWeight(KeyWdWeight), - classColor(std::move(ClsFGColor)), + classColor(ClsFGColor), classWeight(ClsWeight), - quoteColor(std::move(QteFGColor)), + quoteColor(QteFGColor), quoteWeight(QteWeight), - commentColor(std::move(CmtFGColor)), + commentColor(CmtFGColor), commentWeight(CmtWeight), - symbolFGColor(std::move(SymbFGColor)), - symbolBGColor(std::move(SymbBGColor)), + symbolFGColor(SymbFGColor), + symbolBGColor(SymbBGColor), symbolWeight(SymbWeight) {} diff --git a/gui/threadresult.cpp b/gui/threadresult.cpp index 52d683414..8eb625e2e 100644 --- a/gui/threadresult.cpp +++ b/gui/threadresult.cpp @@ -35,7 +35,7 @@ void ThreadResult::reportOut(const std::string &outmsg, Color /*c*/) void ThreadResult::fileChecked(const QString &file) { - QMutexLocker locker(&mutex); + std::lock_guard locker(mutex); mProgress += QFile(file).size(); mFilesChecked++; @@ -50,7 +50,7 @@ void ThreadResult::fileChecked(const QString &file) void ThreadResult::reportErr(const ErrorMessage &msg) { - QMutexLocker locker(&mutex); + std::lock_guard locker(mutex); const ErrorItem item(msg); if (msg.severity != Severity::debug) emit error(item); @@ -60,7 +60,7 @@ void ThreadResult::reportErr(const ErrorMessage &msg) QString ThreadResult::getNextFile() { - QMutexLocker locker(&mutex); + std::lock_guard locker(mutex); if (mFiles.isEmpty()) { return QString(); } @@ -70,7 +70,7 @@ QString ThreadResult::getNextFile() ImportProject::FileSettings ThreadResult::getNextFileSettings() { - QMutexLocker locker(&mutex); + std::lock_guard locker(mutex); if (mFileSettings.empty()) { return ImportProject::FileSettings(); } @@ -81,7 +81,7 @@ ImportProject::FileSettings ThreadResult::getNextFileSettings() void ThreadResult::setFiles(const QStringList &files) { - QMutexLocker locker(&mutex); + std::lock_guard locker(mutex); mFiles = files; mProgress = 0; mFilesChecked = 0; @@ -97,7 +97,7 @@ void ThreadResult::setFiles(const QStringList &files) void ThreadResult::setProject(const ImportProject &prj) { - QMutexLocker locker(&mutex); + std::lock_guard locker(mutex); mFiles.clear(); mFileSettings = prj.fileSettings; mProgress = 0; @@ -113,7 +113,7 @@ void ThreadResult::setProject(const ImportProject &prj) void ThreadResult::clearFiles() { - QMutexLocker locker(&mutex); + std::lock_guard locker(mutex); mFiles.clear(); mFileSettings.clear(); mFilesChecked = 0; @@ -122,6 +122,6 @@ void ThreadResult::clearFiles() int ThreadResult::getFileCount() const { - QMutexLocker locker(&mutex); + std::lock_guard locker(mutex); return mFiles.size() + mFileSettings.size(); } diff --git a/gui/threadresult.h b/gui/threadresult.h index 4e32a1cbe..80ef39b63 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -25,9 +25,9 @@ #include "importproject.h" #include +#include #include -#include #include #include #include @@ -127,7 +127,7 @@ protected: * @brief Mutex * */ - mutable QMutex mutex; + mutable std::mutex mutex; /** * @brief List of files to check diff --git a/releasenotes.txt b/releasenotes.txt index 99fa49afd..51ee1d681 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -14,6 +14,7 @@ Changed interface: Deprecations: - "--showtime=top5" has been deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead. +- Building with Qt5 has been deprecated (it went EOL in May 2023) and will be removed in a future version - please use Qt6 instead. Other: - Windows builds now default to the `native` platform instead of `win32A` or `win64`. Please specify it explicitly if you depend on it.