On 02/07/17 12:21, Dmitry Eremin-Solenikov wrote:
> Hello,
> 
> On 7 February 2017 at 10:14, Maxim Uvarov <[email protected]> wrote:
>> What is function is not used error? Is it gcc or #error in includes?
> 
> First error:
> 
> In file included from ./include/odp_packet_internal.h:28:0,
>                  from odp_classification.c:13:
> ./include/odp_crypto_internal.h:55:5: error: unknown type name 
> ‘EVP_CIPHER_CTX’
>      EVP_CIPHER_CTX *ctx;
>      ^~~~~~~~~~~~~~
> 
> This is fixed by including <openssl/evp.h>
> 
> Second error:
> 
> odp_crypto.c:957:13: error: ‘openssl_lock’ defined but not used
> [-Werror=unused-function]
>  static void openssl_lock(int mode, int n,
>              ^~~~~~~~~~~~
> odp_crypto.c:952:22: error: ‘openssl_thread_id’ defined but not used
> [-Werror=unused-function]
>  static unsigned long openssl_thread_id(void)
>                       ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 

ok.

It's better to split this patch on 2 patches. One for dynamic init array
and other for check for odp version.

As Bill said we need some portable solution which will work with any
version of openssl. We don't know which exactly version will be so we
cover common debian, ubuntu, openembedded and etc versions.

I see that you took define from crypto.h. So portable code might be:

instead of:
+#if OPENSSL_VERSION_NUMBER < 0x10100000L

write:

if (OPENSSL_VERSION_NUMBER < 0x10100000L)
      odp_crypto_init_openssl_locks();


also it's better to avoid ifdefs from not hot code as match as possible,
changing it to local ifs. In that case compiler will check
that not used code is valid.

btw, do not name any internal functions or macros with odp_ prefix. It
stand for api functions.

Maxim.

Reply via email to