[openssl-dev] [openssl.org #4476] PATCH: fix cast-alignment of "struct lhash_st *"

Salz, Rich via RT rt at openssl.org
Thu Mar 24 18:41:34 UTC 2016


This looks like a good change.

> This clears what looks to be hundreds of alignment related warnings like
> below.
> 
> $ git diff include/openssl/lhash.h
> diff --git a/include/openssl/lhash.h b/include/openssl/lhash.h index
> 2edd738..5da5054 100644
> --- a/include/openssl/lhash.h
> +++ b/include/openssl/lhash.h
> @@ -180,7 +180,7 @@ void lh_node_usage_stats_bio(const _LHASH *lh, BIO
> *out);  # define LHASH_OF(type) struct lhash_st_##type
> 
>  # define DEFINE_LHASH_OF(type) \
> -    LHASH_OF(type) { int dummy; }; \
> +    LHASH_OF(type) { unsigned long dummy; }; \
>      static ossl_inline LHASH_OF(type) * \
>          lh_##type##_new(unsigned long (*hfn)(const type *), \
>                          int (*cfn)(const type *, const type *)) \

Does changing it to "void *dummy" also work?


-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4476
Please log in as guest with password guest if prompted



More information about the openssl-dev mailing list