bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] include_next: pacify clang -Winclude-next-absolute-path


From: Bruno Haible
Subject: Re: [PATCH] include_next: pacify clang -Winclude-next-absolute-path
Date: Fri, 29 Dec 2023 10:44:39 +0100

Paul Eggert wrote:
> Use ‘#include <foo.h>’ instead of ‘#include "foo.h"’ if foo.h
> possibly uses #include_next.

Nice. Here's a followup:


2023-12-29  Bruno Haible  <bruno@clisp.org>

        error: More clang -Winclude-next-absolute-path silencing.
        * modules/error (Include): Suggest <error.h>, not "error.h".
        * tests/test-error.c: Write #include <error.h>.
        * tests/test-exclude.c: Likewise.
        * tests/test-verror.c: Likewise.
        * tests/test-xstrtol.c: Likewise.

diff --git a/modules/error b/modules/error
index 88d567674a..4d896ce913 100644
--- a/modules/error
+++ b/modules/error
@@ -31,7 +31,7 @@ lib_SOURCES += error.c
 endif
 
 Include:
-"error.h"
+<error.h>
 
 License:
 LGPLv2+
diff --git a/tests/test-error.c b/tests/test-error.c
index 463b1915c4..f2f7a15fea 100644
--- a/tests/test-error.c
+++ b/tests/test-error.c
@@ -18,7 +18,8 @@
 
 #include <config.h>
 
-#include "error.h"
+/* Specification.  */
+#include <error.h>
 
 #include <errno.h>
 
diff --git a/tests/test-exclude.c b/tests/test-exclude.c
index 5a81cab4be..363dfc3b3e 100644
--- a/tests/test-exclude.c
+++ b/tests/test-exclude.c
@@ -22,8 +22,8 @@
 #include <string.h>
 #include <fnmatch.h>
 
+#include <error.h>
 #include "exclude.h"
-#include "error.h"
 #include "argmatch.h"
 
 #ifndef FNM_CASEFOLD
diff --git a/tests/test-verror.c b/tests/test-verror.c
index 7c808d7908..49b4f51db0 100644
--- a/tests/test-verror.c
+++ b/tests/test-verror.c
@@ -23,7 +23,7 @@
 #include <errno.h>
 #include <stdarg.h>
 
-#include "error.h"
+#include <error.h>
 #include "macros.h"
 
 /* Custom function to not show the program name in error messages.  */
diff --git a/tests/test-xstrtol.c b/tests/test-xstrtol.c
index 9c5d35f6e4..fd37e30a7d 100644
--- a/tests/test-xstrtol.c
+++ b/tests/test-xstrtol.c
@@ -20,8 +20,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#include <error.h>
 #include "xstrtol-error.h"
-#include "error.h"
 
 #ifndef __xstrtol
 # define __xstrtol xstrtol






reply via email to

[Prev in Thread] Current Thread [Next in Thread]