diff --git a/.ci/check-format.sh b/.ci/check-format.sh index e44ccc28d..133e33beb 100755 --- a/.ci/check-format.sh +++ b/.ci/check-format.sh @@ -6,7 +6,7 @@ set -x for file in ${SOURCES}; do - clang-format-16 ${file} > expected-format + clang-format-18 ${file} > expected-format diff -u -p --label="${file}" --label="expected coding style" ${file} expected-format done -exit $(clang-format-16 --output-replacements-xml ${SOURCES} | grep -E -c "") +exit $(clang-format-18 --output-replacements-xml ${SOURCES} | grep -E -c "") diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af0874079..f4f081822 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v4 - name: coding convention run: | - sudo apt-get install -q -y clang-format-16 + sudo apt-get install -q -y clang-format-18 .ci/check-newline.sh .ci/check-format.sh shell: bash diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 48fa54da4..585a6fbe0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,7 @@ However, participation requires adherence to fundamental ground rules: This variant should be considered the standard for all documentation efforts. For instance, opt for "initialize" over "initialise" and "color" rather than "colour". -Software requirement: [clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 12 or later. +Software requirement: [clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later. This repository consistently contains an up-to-date `.clang-format` file with rules that match the explained ones. For maintaining a uniform coding style, execute the command `clang-format -i *.[ch]`. diff --git a/list.h b/list.h index 3d427726a..e964ae0cb 100644 --- a/list.h +++ b/list.h @@ -54,7 +54,7 @@ struct list_head { }) #else #define container_of(ptr, type, member) \ - ((type *) ((char *) (ptr) -offsetof(type, member))) + ((type *) ((char *) (ptr) - offsetof(type, member))) #endif #endif diff --git a/scripts/checksums b/scripts/checksums index 202d14c9b..1180befdd 100644 --- a/scripts/checksums +++ b/scripts/checksums @@ -1,2 +1,2 @@ db6784ff3917888db4d1dceaa0570d99ed40e762 queue.h -3337dbccc33eceedda78e36cc118d5a374838ec7 list.h +bfb6df45d64356868c86a7173455d39970bd0270 list.h