]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
*.mk: lint-c-iwyu: Fail iff iwyu(1) finds problems
authorAlejandro Colomar <alx@kernel.org>
Thu, 31 Aug 2023 00:23:46 +0000 (02:23 +0200)
committerAlejandro Colomar <alx@kernel.org>
Thu, 31 Aug 2023 00:23:55 +0000 (02:23 +0200)
That is, ignore any warnings from clang(1).  We have a different target
for that.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
share/mk/lint/c.mk

index f9e35af36cbc1a667fe3102246619f329e0bfbfd..f354e5b19ee88c089495db4f56595bf110e101e2 100644 (file)
@@ -83,10 +83,14 @@ $(_LINT_c_cpplint): %.lint-c.cpplint.touch: %.c
 
 $(_LINT_c_iwyu): %.lint-c.iwyu.touch: %.c
        $(info LINT (iwyu)      $@)
-       $(IWYU) $(IWYUFLAGS) $(CPPFLAGS) $(CFLAGS) $< 2>&1 \
-       | $(TAC) \
-       | $(SED) '/correct/{N;d}' \
-       | $(TAC) >&2
+       ! ($(IWYU) $(IWYUFLAGS) $(CPPFLAGS) $(CFLAGS) $< 2>&1 \
+          | $(SED) -n '/should add these lines:/,$$p' \
+          | $(TAC) \
+          | $(SED) '/correct/{N;d}' \
+          | $(TAC) \
+          ||:; \
+       ) \
+       | $(GREP) ^ >&2
        touch $@