diff options
author | Richard Levitte <levitte@openssl.org> | 2019-02-15 08:06:36 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-02-15 11:44:35 +0100 |
commit | 48fe4ce104df060dd5d2b4188a56eb554d94d819 (patch) | |
tree | cf10b38186c0b540ba2ad7f165e72ba9ae7f43e3 /crypto | |
parent | Add option to disable Extended Master Secret (diff) | |
download | openssl-48fe4ce104df060dd5d2b4188a56eb554d94d819.tar.xz openssl-48fe4ce104df060dd5d2b4188a56eb554d94d819.zip |
Mark generated functions unused (applies to safestack, lhash, sparse_array)
safestack.h, lhash.h and sparse_array.h all define macros to generate
a full API for the containers as static inline functions. This
potentially generates unused code, which some compilers may complain
about.
We therefore need to mark those generated functions as unused, so the
compiler knows that we know, and stops complaining about it.
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/8246)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/include/internal/sparse_array.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/crypto/include/internal/sparse_array.h b/crypto/include/internal/sparse_array.h index 839fcedde4..648e41a2b8 100644 --- a/crypto/include/internal/sparse_array.h +++ b/crypto/include/internal/sparse_array.h @@ -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); \ |