Topic: warning: "XREALLOC"

Hi everybody!

I'm new here so be gentle wink since the update of Wolfssl to 4.1.0 I get these errors? Does anybody knows how to resolve them?

CC /project/components/common/wolfssl/wolfssl-4.1.0/wolfcrypt/src/arc4.c
In file included from /project/components/common/wolfssl/wolfssl-4.1.0/wolfssl/wolfcrypt/error-crypt.h:29:0,
                from /project/components/common/wolfssl/wolfssl-4.1.0/wolfcrypt/src/arc4.c:31:
/project/components/common/wolfssl/wolfssl-4.1.0/wolfssl/wolfcrypt/types.h:295:0: warning: "XREALLOC" redefined [enabled by default]
        #define XREALLOC(p, n, h, t) realloc((p), (n))
^

Best regrads

Share

2 (edited by Kaleb J. Himes 2019-10-09 09:59:37)

Re: warning: "XREALLOC"

Hi achimpieters,

Thank you so much for reaching out with your question. Can you tell us a bit about the background of this project and your use-case?

Typically a re-definition means that there are conflicting settings being used.

Given you are seeing an error on line 295 of types.h may I assume you are using static memory? Can you share the settings you are using to configure wolfSSL?


Warm Regards,

K

3 (edited by achimpieters 2019-10-09 11:47:55)

Re: warning: "XREALLOC"

Hi Kaleb,

Thank you for your response. Wolfssl is used in this repro: https://github.com/maximkulkin/esp-homekit-demo. Before the update everything worked like a charm, But after updating to Wolfssl 4.1.0 I get these warnings when compiling.

When generating a .bin file these warnings show up, but It still works. Hope you can help, or can give a solution fore these errrors?
See attachment.

Thanks in advance & best regards,

Achim Pieters

Post's attachments

example.txt 46.64 kb, 3 downloads since 2019-10-09 

You don't have the permssions to download the attachments of this post.

Share

Re: warning: "XREALLOC"

@achimpieters,

It sounds like something in the file <wolfssl/wolfcrypt/settings.h> is defining XREALLOC to be one thing but then later in wolfssl/wolfcrypt/types.h where we try to detect based on OS/OE and set it smartly there is something not being skipped. Can you try adding a condition to types.h for

&& !defined(<>)

and replace the "<>" with the setting from settings.h that is defined and causing XREALLOC to be configured in settings.h?

It's hard to pin-point exactly without being able to test/build it but from the log we see the original definition is in settings.h on line 669 which in the version of settings.h I'm looking at from 4.1.0 would be in the FREERTOS section.

/project/components/common/wolfssl/wolfssl-4.1.0/wolfssl/wolfcrypt/settings.h:669:0: note: this is the location of the previous definition
         #define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n))

In types.h the re-definition happens on line 295 which is inside a section protected by the setting "NO_WOLFSSL_MEMORY" setting which leads me to believe that somehow both FREERTOS and NO_WOLFSSL_MEMORY are getting set together.

/project/components/common/wolfssl/wolfssl-4.1.0/wolfssl/wolfcrypt/types.h:295:0: warning: "XREALLOC" redefined [enabled by default]
         #define XREALLOC(p, n, h, t) realloc((p), (n))

To resolve you can either remove NO_WOLFSSL_MEMORY from any custom settings you are using or you can add a second condition on line 273 of types.h to be:

#elif defined(NO_WOLFSSL_MEMORY) && !defined(FREERTOS)

Warm Regards,

K

Re: warning: "XREALLOC"

@Kaleb,

Thank you for your swift response! We will have a look into it!

Share