On 07.02.2017 18:59, Maxim Uvarov wrote:
On 02/07/17 12:21, Dmitry Eremin-Solenikov wrote:
Hello,

On 7 February 2017 at 10:14, Maxim Uvarov <maxim.uva...@linaro.org> 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.

As I wrote previously, there is no way to have an app to be compiled against OpenSSL 1.0.x and running agains 1.1.y or vice versa. SONAMEs are different.

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.

I can mark those functions with __attribute__((unused)), if you'd prefer that over ifdefs. Is that better from your POV?


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

ack.

--
With best wishes
Dmitry

Reply via email to