bug-gnulib
[Top][All Lists]
Advanced

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

af_alg: Avoid warnings


From: Bruno Haible
Subject: af_alg: Avoid warnings
Date: Sun, 06 May 2018 17:01:36 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-119-generic; KDE/5.18.0; x86_64; ; )

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  <address@hidden>

        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.],




reply via email to

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