From cf67632c7547b7d3b0ed33457a74ea160b373984 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 9 Mar 2026 11:06:08 -0400 Subject: [PATCH 1/5] build: use ifdef guard in generated config file --- include/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/include/meson.build b/include/meson.build index 165166c33..ccfc56e81 100644 --- a/include/meson.build +++ b/include/meson.build @@ -35,4 +35,5 @@ endforeach wlr_files += configure_file( output: 'config.h', configuration: internal_config, + macro_name: 'CONFIG_H', ) From e9e4896a2199d3bc81ee6ae9e9b0d3526013b6a7 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 9 Mar 2026 11:06:51 -0400 Subject: [PATCH 2/5] color_representation_v1: fix swapped parameter for wp_color_representation_surface_v1_chroma_location_is_valid --- types/wlr_color_representation_v1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/wlr_color_representation_v1.c b/types/wlr_color_representation_v1.c index 856dc84f8..b35ba6550 100644 --- a/types/wlr_color_representation_v1.c +++ b/types/wlr_color_representation_v1.c @@ -180,8 +180,7 @@ static void color_repr_handle_set_chroma_location(struct wl_client *client, } uint32_t version = wl_resource_get_version(resource); - if (!wp_color_representation_surface_v1_chroma_location_is_valid( - version, chroma_location)) { + if (!wp_color_representation_surface_v1_chroma_location_is_valid(chroma_location, version)) { wl_resource_post_error(resource, WP_COLOR_REPRESENTATION_SURFACE_V1_ERROR_CHROMA_LOCATION, "Chroma location is not a valid enum value"); return; From fe8f7665961c816f2ee981bdfc9a4aac6ab3d39f Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 9 Mar 2026 11:07:27 -0400 Subject: [PATCH 3/5] xwayland: remove duplicated stdlib include --- xwayland/server.c | 1 - xwayland/xwayland.c | 1 - 2 files changed, 2 deletions(-) diff --git a/xwayland/server.c b/xwayland/server.c index 0e8ad44fe..0d4013660 100644 --- a/xwayland/server.c +++ b/xwayland/server.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index 300b582ea..702a50740 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include From 2485e3bceb1c143077842bac258c07cfb23c4315 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 9 Mar 2026 11:09:50 -0400 Subject: [PATCH 4/5] add .clang-tidy file --- .clang-tidy | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..3e4e3dbcc --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,73 @@ +# First block is the enabled checks +# Second block is the disabled checks +# Third block is the checks to fix +Checks: | + bugprone-*, + cert-*, + clang-analyzer-*, + clang-diagnostic-*, + concurrency-*, + misc-*, + modernize-*, + performance-*, + portability-*, + readability-*, + + -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, + + -bugprone-assignment-in-if-condition, + -bugprone-branch-clone, + -bugprone-easily-swappable-parameters, + -bugprone-implicit-widening-of-multiplication-result, + -bugprone-macro-parentheses, + -bugprone-multi-level-implicit-pointer-conversion, + -bugprone-narrowing-conversions, + -bugprone-reserved-identifier, + -bugprone-sizeof-expression, + -bugprone-suspicious-memory-comparison, + -bugprone-suspicious-realloc-usage, + -bugprone-suspicious-string-compare, + -bugprone-switch-missing-default-case, + -cert-dcl37-c, + -cert-dcl51-cpp, + -cert-err33-c, + -cert-err34-c, + -cert-exp42-c, + -cert-flp37-c, + -clang-analyzer-core.NullDereference, + -clang-analyzer-core.uninitialized.Assign, + -clang-analyzer-optin.core.EnumCastOutOfRange, + -clang-analyzer-optin.portability.UnixAPI, + -clang-analyzer-optin.taint.GenericTaint, + -clang-analyzer-optin.taint.TaintedAlloc, + -clang-analyzer-security.ArrayBound, + -clang-analyzer-unix.Malloc, + -clang-analyzer-valist.Uninitialized, + -concurrency-mt-unsafe, + -misc-include-cleaner, + -misc-no-recursion, + -misc-unused-parameters, + -modernize-macro-to-enum, + -modernize-use-nullptr, + -performance-no-int-to-ptr, + -performance-type-promotion-in-math-fn, + -readability-avoid-nested-conditional-operator, + -readability-braces-around-statements, + -readability-else-after-return, + -readability-function-cognitive-complexity, + -readability-function-size, + -readability-identifier-length, + -readability-implicit-bool-conversion, + -readability-inconsistent-declaration-parameter-name, + -readability-isolate-declaration, + -readability-magic-numbers, + -readability-math-missing-parentheses, + -readability-non-const-parameter, + -readability-simplify-boolean-expr, + -readability-suspicious-call-argument, + -readability-uppercase-literal-suffix, + -readability-use-concise-preprocessor-directives, + +WarningsAsErrors: '*' +HeaderFilterRegex: '^include/.*' +FormatStyle: file From 61e016137f06be31e3f0c98d437415f09f7fc502 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 9 Mar 2026 11:10:09 -0400 Subject: [PATCH 5/5] ci: add clang-tidy step to alpine build --- .builds/alpine.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.builds/alpine.yml b/.builds/alpine.yml index affd85411..e41349266 100644 --- a/.builds/alpine.yml +++ b/.builds/alpine.yml @@ -20,6 +20,7 @@ packages: - xwayland-dev - libseat-dev - hwdata-dev + - clang-extra-tools # for docs - go - zip @@ -55,3 +56,6 @@ tasks: -o public \ "$include_dir/wlr/" zip -r ~/public.zip public/ + - clang-tidy: | + cd wlroots + ninja -C build clang-tidy