From 81fd6b169801c80edfdcd2f71a8c4975c97fa3a3 Mon Sep 17 00:00:00 2001 From: Ozan Tezcan Date: Sat, 15 Feb 2025 12:24:51 +0300 Subject: [PATCH] Fix build (#134) Fix build --- .github/workflows/.aarch64.yml | 4 ++-- .github/workflows/.armv6.yml | 2 +- .github/workflows/.armv7.yml | 2 +- .github/workflows/.ppc64le.yml | 4 ++-- .github/workflows/.riscv64.yml | 4 ++-- .github/workflows/.s390x.yml | 4 ++-- .github/workflows/.ubuntu.yml | 36 ++++++++++++++++++++++++++-------- CMakeLists.txt | 9 +++++---- array/CMakeLists.txt | 3 ++- buffer/CMakeLists.txt | 5 +++-- condition/CMakeLists.txt | 5 +++-- crc32/CMakeLists.txt | 5 +++-- heap/CMakeLists.txt | 5 +++-- ini/CMakeLists.txt | 5 +++-- ini/sc_ini.c | 2 +- linked-list/CMakeLists.txt | 5 +++-- logger/CMakeLists.txt | 5 +++-- logger/sc_log.c | 3 ++- map/CMakeLists.txt | 5 +++-- memory-map/CMakeLists.txt | 5 +++-- mutex/CMakeLists.txt | 5 +++-- option/CMakeLists.txt | 3 ++- perf/CMakeLists.txt | 2 +- queue/CMakeLists.txt | 3 ++- sc/CMakeLists.txt | 5 +++-- signal/CMakeLists.txt | 5 +++-- socket/CMakeLists.txt | 3 ++- socket/sock_test.c | 2 +- string/CMakeLists.txt | 5 +++-- thread/CMakeLists.txt | 5 +++-- time/CMakeLists.txt | 5 +++-- timer/CMakeLists.txt | 5 +++-- uri/CMakeLists.txt | 5 +++-- 33 files changed, 107 insertions(+), 64 deletions(-) diff --git a/.github/workflows/.aarch64.yml b/.github/workflows/.aarch64.yml index cdd2230..d7b5216 100644 --- a/.github/workflows/.aarch64.yml +++ b/.github/workflows/.aarch64.yml @@ -15,12 +15,12 @@ jobs: name: Build on aarch64 steps: - uses: actions/checkout@v2.1.0 - - uses: uraimo/run-on-arch-action@v2.1.1 + - uses: uraimo/run-on-arch-action@v2.8.1 name: Build artifact id: build with: arch: aarch64 - distro: ubuntu20.04 + distro: ubuntu22.04 # Not required, but speeds up builds githubToken: ${{ github.token }} diff --git a/.github/workflows/.armv6.yml b/.github/workflows/.armv6.yml index e260ca0..80af0c5 100644 --- a/.github/workflows/.armv6.yml +++ b/.github/workflows/.armv6.yml @@ -15,7 +15,7 @@ jobs: name: Build on armv6 steps: - uses: actions/checkout@v2.1.0 - - uses: uraimo/run-on-arch-action@v2.1.1 + - uses: uraimo/run-on-arch-action@v2.8.1 name: Build artifact id: build with: diff --git a/.github/workflows/.armv7.yml b/.github/workflows/.armv7.yml index 61f8756..b79a946 100644 --- a/.github/workflows/.armv7.yml +++ b/.github/workflows/.armv7.yml @@ -15,7 +15,7 @@ jobs: name: Build on armv7 steps: - uses: actions/checkout@v2.1.0 - - uses: uraimo/run-on-arch-action@v2.1.1 + - uses: uraimo/run-on-arch-action@v2.8.1 name: Build artifact id: build with: diff --git a/.github/workflows/.ppc64le.yml b/.github/workflows/.ppc64le.yml index 56cb755..1eecba6 100644 --- a/.github/workflows/.ppc64le.yml +++ b/.github/workflows/.ppc64le.yml @@ -15,12 +15,12 @@ jobs: name: Build on ppc64le steps: - uses: actions/checkout@v2.1.0 - - uses: uraimo/run-on-arch-action@v2.1.1 + - uses: uraimo/run-on-arch-action@v2.8.1 name: Build artifact id: build with: arch: ppc64le - distro: ubuntu20.04 + distro: ubuntu22.04 # Not required, but speeds up builds githubToken: ${{ github.token }} diff --git a/.github/workflows/.riscv64.yml b/.github/workflows/.riscv64.yml index 65dd8da..a9db464 100644 --- a/.github/workflows/.riscv64.yml +++ b/.github/workflows/.riscv64.yml @@ -15,12 +15,12 @@ jobs: name: Build on riscv64 steps: - uses: actions/checkout@v2.1.0 - - uses: uraimo/run-on-arch-action@v2.5.1 + - uses: uraimo/run-on-arch-action@v2.8.1 name: Build artifact id: build with: arch: riscv64 - distro: ubuntu20.04 + distro: ubuntu22.04 # Not required, but speeds up builds githubToken: ${{ github.token }} diff --git a/.github/workflows/.s390x.yml b/.github/workflows/.s390x.yml index caa6083..5d3ea30 100644 --- a/.github/workflows/.s390x.yml +++ b/.github/workflows/.s390x.yml @@ -15,12 +15,12 @@ jobs: name: Build on s390x steps: - uses: actions/checkout@v2.1.0 - - uses: uraimo/run-on-arch-action@v2.1.1 + - uses: uraimo/run-on-arch-action@v2.8.1 name: Build artifact id: build with: arch: s390x - distro: ubuntu20.04 + distro: ubuntu22.04 # Not required, but speeds up builds githubToken: ${{ github.token }} diff --git a/.github/workflows/.ubuntu.yml b/.github/workflows/.ubuntu.yml index e0cda83..ebef0ea 100644 --- a/.github/workflows/.ubuntu.yml +++ b/.github/workflows/.ubuntu.yml @@ -17,23 +17,18 @@ on: jobs: ubuntu: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 if: | (github.event_name == 'pull_request') || (github.event_name == 'push') || (github.event_name == 'workflow_dispatch' || (github.event_name == 'schedule' && github.repository == 'tezc/sc')) && !contains(github.event.inputs.skip, 'ubuntu') name: Build on Ubuntu - - strategy: - fail-fast: false - matrix: - compiler: [ gcc, clang ] steps: - uses: actions/checkout@v2.1.0 - name: build env: - CC: ${{ matrix.compiler }} + CC: gcc run: | sudo apt update sudo apt-get install valgrind cmake @@ -50,6 +45,31 @@ jobs: make -j make valgrind + ubuntu-clang: + runs-on: ubuntu-22.04 + if: | + (github.event_name == 'pull_request') || + (github.event_name == 'push') || + (github.event_name == 'workflow_dispatch' || + (github.event_name == 'schedule' && github.repository == 'tezc/sc')) && !contains(github.event.inputs.skip, 'ubuntu') + name: Build on Ubuntu + steps: + - uses: actions/checkout@v2.1.0 + - name: build + env: + CC: clang + run: | + sudo apt update + sudo apt-get install valgrind cmake + mkdir build-debug && cd build-debug + cmake .. -DSANITIZER=address + make -j + make check + rm -rf * + cmake .. -DSANITIZER=undefined + make -j + make check + ubuntu-gcc-thread: runs-on: ubuntu-latest if: | @@ -145,7 +165,7 @@ jobs: sudo apt update sudo apt-get install cmake curl tar wine mkdir build-debug && cd build-debug - export ZIG=zig-linux-x86_64-0.12.0-dev.1834+f36ac227b + export ZIG=zig-linux-x86_64-0.14.0-dev.3222+8a3aebaee curl -o zig.tar.xz "https://ziglang.org/builds/$ZIG.tar.xz" tar -xf zig.tar.xz export CC="$(pwd)/$ZIG/zig cc -target x86_64-windows" diff --git a/CMakeLists.txt b/CMakeLists.txt index c33fea3..ef153e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_lib C) include(CTest) include(CheckCCompilerFlag) @@ -68,11 +68,12 @@ if (SC_BUILD_TEST) add_custom_target(coverage) add_custom_command( TARGET coverage + POST_BUILD COMMAND lcov --capture --directory . - --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' + --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' --ignore-errors unused COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' - --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' - COMMAND lcov --list coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' + --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' --ignore-errors unused + COMMAND lcov --list coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' --ignore-errors unused ) # -------------------------- Code Coverage End ------------------------------ # diff --git a/array/CMakeLists.txt b/array/CMakeLists.txt index c3cd1b7..9a7ab50 100644 --- a/array/CMakeLists.txt +++ b/array/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_array C) set(CMAKE_C_STANDARD 99) @@ -96,6 +96,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/buffer/CMakeLists.txt b/buffer/CMakeLists.txt index dba2981..86c0ab1 100644 --- a/buffer/CMakeLists.txt +++ b/buffer/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_buf C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -95,6 +95,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/condition/CMakeLists.txt b/condition/CMakeLists.txt index 92981f7..c9576b6 100644 --- a/condition/CMakeLists.txt +++ b/condition/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_cond C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -96,6 +96,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/crc32/CMakeLists.txt b/crc32/CMakeLists.txt index 835ff7d..0cd4620 100644 --- a/crc32/CMakeLists.txt +++ b/crc32/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_crc32 C) set(CMAKE_C_STANDARD 99) @@ -32,7 +32,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-implicit-widening-of-multiplication-result*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-implicit-widening-of-multiplication-result*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -113,6 +113,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/heap/CMakeLists.txt b/heap/CMakeLists.txt index 28a8816..8b0d1fd 100644 --- a/heap/CMakeLists.txt +++ b/heap/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_heap C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-misc-include-cleaner*,-bugprone-assignment-in-if-condition*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -94,6 +94,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/ini/CMakeLists.txt b/ini/CMakeLists.txt index 8cff57f..64ed49d 100644 --- a/ini/CMakeLists.txt +++ b/ini/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_ini C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-misc-include-cleaner*,-bugprone-assignment-in-if-condition*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -93,6 +93,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/ini/sc_ini.c b/ini/sc_ini.c index 06eca38..c0901b7 100644 --- a/ini/sc_ini.c +++ b/ini/sc_ini.c @@ -191,5 +191,5 @@ int sc_ini_parse_file(void *arg, sc_ini_on_item cb, const char *filename) int sc_ini_parse_string(void *arg, sc_ini_on_item cb, const char *str) { char *ptr = (char *) str; - return sc_ini_parse(arg, cb, &ptr, string_line); + return sc_ini_parse(arg, cb, (void*) &ptr, string_line); } diff --git a/linked-list/CMakeLists.txt b/linked-list/CMakeLists.txt index 6cee86c..9c0880d 100644 --- a/linked-list/CMakeLists.txt +++ b/linked-list/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_list C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -83,6 +83,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/logger/CMakeLists.txt b/logger/CMakeLists.txt index 94a3ce0..1213516 100644 --- a/logger/CMakeLists.txt +++ b/logger/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_log C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-bugprone-reserved-identifier*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-bugprone-reserved-identifier*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -96,6 +96,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/logger/sc_log.c b/logger/sc_log.c index 4630633..bd5da24 100644 --- a/logger/sc_log.c +++ b/logger/sc_log.c @@ -224,7 +224,8 @@ static int sc_strcasecmp(const char *a, const char *b) return 0; } - if ((n = tolower(*a) - tolower(*b)) != 0) { + n = tolower(*a) - tolower(*b); + if (n != 0) { return n; } } diff --git a/map/CMakeLists.txt b/map/CMakeLists.txt index 169aff5..117a651 100644 --- a/map/CMakeLists.txt +++ b/map/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_map C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -103,6 +103,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/memory-map/CMakeLists.txt b/memory-map/CMakeLists.txt index e68c609..757627a 100644 --- a/memory-map/CMakeLists.txt +++ b/memory-map/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_mmap C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-bugprone-reserved-identifier*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-bugprone-reserved-identifier*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -98,6 +98,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/mutex/CMakeLists.txt b/mutex/CMakeLists.txt index f88edfb..d87ac9c 100644 --- a/mutex/CMakeLists.txt +++ b/mutex/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_mutex C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -97,6 +97,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/option/CMakeLists.txt b/option/CMakeLists.txt index 81cf973..7980040 100644 --- a/option/CMakeLists.txt +++ b/option/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_option C) set(CMAKE_C_STANDARD 99) @@ -97,6 +97,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/perf/CMakeLists.txt b/perf/CMakeLists.txt index cd872e8..fe94120 100644 --- a/perf/CMakeLists.txt +++ b/perf/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_perf C) set(CMAKE_C_STANDARD 99) diff --git a/queue/CMakeLists.txt b/queue/CMakeLists.txt index 024b263..c73e371 100644 --- a/queue/CMakeLists.txt +++ b/queue/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_queue C) set(CMAKE_C_STANDARD 99) @@ -98,6 +98,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/sc/CMakeLists.txt b/sc/CMakeLists.txt index 2069930..b27ce6b 100644 --- a/sc/CMakeLists.txt +++ b/sc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -96,6 +96,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/signal/CMakeLists.txt b/signal/CMakeLists.txt index 6a2eff1..c4fd951 100644 --- a/signal/CMakeLists.txt +++ b/signal/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_signal C) set(CMAKE_C_STANDARD 99) @@ -35,7 +35,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -126,6 +126,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/socket/CMakeLists.txt b/socket/CMakeLists.txt index 48694df..b5347c2 100644 --- a/socket/CMakeLists.txt +++ b/socket/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_socket C) set(CMAKE_C_STANDARD 99) @@ -110,6 +110,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/socket/sock_test.c b/socket/sock_test.c index 08b3343..48ba5f6 100644 --- a/socket/sock_test.c +++ b/socket/sock_test.c @@ -1755,7 +1755,7 @@ void test_poll_threadsafe(void) { enum { - THREAD_COUNT = 100 + THREAD_COUNT = 10 }; uint32_t ev; int rc, count, added = 0; diff --git a/string/CMakeLists.txt b/string/CMakeLists.txt index fb93b2d..12c0ae3 100644 --- a/string/CMakeLists.txt +++ b/string/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_str C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-misc-include-cleaner*,-bugprone-assignment-in-if-condition*,-bugprone-suspicious-realloc-usage*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -95,6 +95,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/thread/CMakeLists.txt b/thread/CMakeLists.txt index 388d195..56db478 100644 --- a/thread/CMakeLists.txt +++ b/thread/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_thread C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -95,6 +95,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/time/CMakeLists.txt b/time/CMakeLists.txt index 7092252..9dd0f24 100644 --- a/time/CMakeLists.txt +++ b/time/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_time C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -94,6 +94,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/timer/CMakeLists.txt b/timer/CMakeLists.txt index a5bb126..bcf90cd 100644 --- a/timer/CMakeLists.txt +++ b/timer/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_timer C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-bugprone-implicit-widening-of-multiplication-result*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-bugprone-implicit-widening-of-multiplication-result*,-misc-include-cleaner*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -96,6 +96,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*' diff --git a/uri/CMakeLists.txt b/uri/CMakeLists.txt index 9920ac1..438c74d 100644 --- a/uri/CMakeLists.txt +++ b/uri/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5.1) +cmake_minimum_required(VERSION 3.10) project(sc_uri C) set(CMAKE_C_STANDARD 99) @@ -31,7 +31,7 @@ if (SC_BUILD_TEST) set(CMAKE_C_CLANG_TIDY clang-tidy; -line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}]; - -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*; + -checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-misc-include-cleaner*,-bugprone-assignment-in-if-condition*; -warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;) endif () @@ -94,6 +94,7 @@ if (SC_BUILD_TEST) add_custom_target(coverage_${PROJECT_NAME}) add_custom_command( TARGET coverage_${PROJECT_NAME} + POST_BUILD COMMAND lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 --rc lcov_excl_br_line='assert' COMMAND lcov --remove coverage.info '/usr/*' '*example*' '*test*'