Mark generated functions unused (applies to safestack, lhash, sparse_array)
[openssl.git] / crypto / include / internal / sparse_array.h
index 839fced..648e41a 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef HEADER_SPARSE_ARRAY_H
 # define HEADER_SPARSE_ARRAY_H
 
+# include <openssl/e_os2.h>
+
 # ifdef __cplusplus
 extern "C" {
 # endif
@@ -19,43 +21,42 @@ extern "C" {
 
 # define DEFINE_SPARSE_ARRAY_OF(type) \
     SPARSE_ARRAY_OF(type); \
-    static ossl_inline SPARSE_ARRAY_OF(type) * \
+    static ossl_unused ossl_inline SPARSE_ARRAY_OF(type) * \
         ossl_sa_##type##_new(void) \
     { \
         return (SPARSE_ARRAY_OF(type) *)OPENSSL_SA_new(); \
     } \
-    static ossl_inline void ossl_sa_##type##_free(SPARSE_ARRAY_OF(type) *sa) \
+    static ossl_unused ossl_inline void ossl_sa_##type##_free(SPARSE_ARRAY_OF(type) *sa) \
     { \
         OPENSSL_SA_free((OPENSSL_SA *)sa); \
     } \
-    static ossl_inline void ossl_sa_##type##_free_leaves(SPARSE_ARRAY_OF(type) *sa) \
+    static ossl_unused ossl_inline void ossl_sa_##type##_free_leaves(SPARSE_ARRAY_OF(type) *sa) \
     { \
         OPENSSL_SA_free_leaves((OPENSSL_SA *)sa); \
     } \
-    static ossl_inline size_t ossl_sa_##type##_num(const SPARSE_ARRAY_OF(type) *sa) \
+    static ossl_unused ossl_inline size_t ossl_sa_##type##_num(const SPARSE_ARRAY_OF(type) *sa) \
     { \
         return OPENSSL_SA_num((OPENSSL_SA *)sa); \
     } \
-    static ossl_inline void ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) *sa, \
+    static ossl_unused ossl_inline void ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) *sa, \
                                                    void (*leaf)(size_t, type *)) \
     { \
         OPENSSL_SA_doall((OPENSSL_SA *)sa, (void (*)(size_t, void *))leaf); \
     } \
-    static ossl_inline void ossl_sa_##type##_doall_arg(const SPARSE_ARRAY_OF(type) *sa, \
-                                                       void (*leaf)(size_t, \
-                                                                    type *, \
-                                                                   void *),\
-                                                       void *arg) \
+    static ossl_unused ossl_inline \
+    void ossl_sa_##type##_doall_arg(const SPARSE_ARRAY_OF(type) *sa, \
+                                    void (*leaf)(size_t, type *, void *), \
+                                    void *arg) \
     { \
         OPENSSL_SA_doall_arg((OPENSSL_SA *)sa, (void (*)(size_t, void *, void *))leaf, \
                              arg); \
     } \
-    static ossl_inline type *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, \
+    static ossl_unused ossl_inline type *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, \
                                                   size_t n) \
     { \
         return (type *)OPENSSL_SA_get((OPENSSL_SA *)sa, n); \
     } \
-    static ossl_inline int ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) *sa, \
+    static ossl_unused ossl_inline int ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) *sa, \
                                                 size_t n, type *val) \
     { \
         return OPENSSL_SA_set((OPENSSL_SA *)sa, n, (void *)val); \