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 <alan.coopersmith@oracle.com>
This commit is contained in:
Alan Coopersmith
2024-01-15 11:44:21 -08:00
parent 10e0e12fcf
commit 7899231c65

View File

@@ -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])