Bruno Haible
2018-05-06 15:01:36 UTC
When --without-linux-crypto is in effect and the file "af_alg.h" gets included
but the function is not used, gcc produces a warning.
The best way to avoid this warning is to mark the function as inline.
Additionally, this function is really meant to be inlined, also on non-GCC
compilers.
2018-05-06 Bruno Haible <***@clisp.org>
af_alg: Avoid warnings.
* lib/af_alg.h (afalg_stream): Mark fallback declaration as inline.
* m4/af_alg.m4 (gl_AF_ALG): Require AC_C_INLINE.
diff --git a/lib/af_alg.h b/lib/af_alg.h
index dfcc995..45c2c12 100644
--- a/lib/af_alg.h
+++ b/lib/af_alg.h
@@ -64,7 +64,7 @@ afalg_stream (FILE *stream, const char *alg, void *resblock, ssize_t hashlen);
# else
-static int
+static inline int
afalg_stream (FILE *stream, const char *alg, void *resblock, ssize_t hashlen)
{
return -EAFNOSUPPORT;
diff --git a/m4/af_alg.m4 b/m4/af_alg.m4
index f7176f3..db7150e 100644
--- a/m4/af_alg.m4
+++ b/m4/af_alg.m4
@@ -1,4 +1,4 @@
-# af_alg.m4 serial 2
+# af_alg.m4 serial 3
dnl Copyright 2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,6 +9,7 @@ dnl From Matteo Croce.
AC_DEFUN_ONCE([gl_AF_ALG],
[
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ AC_REQUIRE([AC_C_INLINE])
dnl Check whether linux/if_alg.h has needed features.
AC_CACHE_CHECK([whether linux/if_alg.h has struct sockaddr_alg.],
but the function is not used, gcc produces a warning.
The best way to avoid this warning is to mark the function as inline.
Additionally, this function is really meant to be inlined, also on non-GCC
compilers.
2018-05-06 Bruno Haible <***@clisp.org>
af_alg: Avoid warnings.
* lib/af_alg.h (afalg_stream): Mark fallback declaration as inline.
* m4/af_alg.m4 (gl_AF_ALG): Require AC_C_INLINE.
diff --git a/lib/af_alg.h b/lib/af_alg.h
index dfcc995..45c2c12 100644
--- a/lib/af_alg.h
+++ b/lib/af_alg.h
@@ -64,7 +64,7 @@ afalg_stream (FILE *stream, const char *alg, void *resblock, ssize_t hashlen);
# else
-static int
+static inline int
afalg_stream (FILE *stream, const char *alg, void *resblock, ssize_t hashlen)
{
return -EAFNOSUPPORT;
diff --git a/m4/af_alg.m4 b/m4/af_alg.m4
index f7176f3..db7150e 100644
--- a/m4/af_alg.m4
+++ b/m4/af_alg.m4
@@ -1,4 +1,4 @@
-# af_alg.m4 serial 2
+# af_alg.m4 serial 3
dnl Copyright 2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,6 +9,7 @@ dnl From Matteo Croce.
AC_DEFUN_ONCE([gl_AF_ALG],
[
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+ AC_REQUIRE([AC_C_INLINE])
dnl Check whether linux/if_alg.h has needed features.
AC_CACHE_CHECK([whether linux/if_alg.h has struct sockaddr_alg.],