This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2434: lwip-builds with #define LWIP_NOASSERT fails

Part Number: AM2434

Hello, 

for our release-build we do not want to set the asserts. so we defined LWIP_NOASSERT in the lwipopts.h.

We are using Industrial Comms 11 with the latest release. But now the -Werror compile option in the TI make-scripts produces this:

error: unused variable 'anyVariableUsedOnlyInAssertCall'

for every variable that is only created to be used in an assert. 

I think this should be fixed. 

Best regards

Felix

  • Hi Felix,

    Ideally, the variables which are used within the context of LwIP for error handling only should be used with the macro 'LWIP_UNUSED_ARG()' to handle this gracefully. This has been done in the sample example of lwip stack, and also in the examples available in MCU+ SDK. 

    Can you please share whether you are observing these errors while building the libraries or while building the examples? I will check this internally as well, and let you know my results. If the errors are seen, I will take this feedback to the internal team to handle the errors in the SDK.

    Thanks and regards,
    Teja.

  • Hey Teja, 
    sorry for the late reply:
    This happens when building the libraries. The message also makes sense if you check the code.
    To reproduce: set the LWIP_NOASSERT in the used lwipopts.h header file:

    and when compiling you will get the error:

    If you look into the related code, you can see that this variable is only used for the assert, but without the mentioned LWIP_UNUSED_ARG():

    And if LWIP_NOASSERT is set, the LWIP_ASSERT-call will translate to:

    which does not use the variable. 

    This happens to some more places in the code. 

    best regards
    Felix

  • Hi Felix,

    We are able to reproduce the issue, and looking into possible causes of this occurrence. This seems to be a LwIP stack related issue, where the corresponding errors are not handled in the public release itself. Please let me confirm if that is the case.

    As a solution, you would be able to modify the lwip_assert declaration such that it will not take much additional cycles, and use the condition given as input.

    Thanks and regards,
    Teja.