From 7899231c65d68d3b0cef0c5a3a5553d9d566ebdc Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 15 Jan 2024 11:44:21 -0800 Subject: [PATCH] Quiet -Wredundant-decls warnings for strlcat and strlcpy In file included from /usr/include/xorg/misc.h:119, from /usr/include/xorg/xf86str.h:37, from /usr/include/xorg/xf86.h:44, from v4l.c:25: /usr/include/xorg/os.h:595:1: warning: redundant redeclaration of 'strlcpy' [-Wredundant-decls] 595 | strlcpy(char *dst, const char *src, size_t siz); | ^~~~~~~ In file included from v4l.c:19: /usr/include/string.h:506:15: note: previous declaration of 'strlcpy' with type 'size_t(char * restrict, const char * restrict, size_t)' {aka 'long unsigned int(char * restrict, const char * restrict, long unsigned int)'} 506 | extern size_t strlcpy (char *__restrict __dest, | ^~~~~~~ /usr/include/xorg/os.h:597:1: warning: redundant redeclaration of 'strlcat' [-Wredundant-decls] 597 | strlcat(char *dst, const char *src, size_t siz); | ^~~~~~~ /usr/include/string.h:512:15: note: previous declaration of 'strlcat' with type 'size_t(char * restrict, const char * restrict, size_t)' {aka 'long unsigned int(char * restrict, const char * restrict, long unsigned int)'} 512 | extern size_t strlcat (char *__restrict __dest, | ^~~~~~~ Signed-off-by: Alan Coopersmith --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 00d3ca7..bc599fd 100644 --- a/configure.ac +++ b/configure.ac @@ -59,7 +59,10 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto) # Obtain compiler/linker options for the driver dependencies PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto $REQUIRED_MODULES]) -# Checks for libraries. +# Checks for library functions +# We don't use strlcat or strlcpy, but check to quiet a -Wredundant-decls warning +# from xorg/os.h which will otherwise redefine it. +AC_CHECK_FUNCS([strlcat strlcpy]) AC_SUBST([moduledir])