AnsweredAssumed Answered

STM32 Cyptolib with IAR 8.11

Question asked by Giuseppe Cannarella on Apr 13, 2017
Latest reply on Apr 30, 2018 by David Henretty

I've my application that uses the xCube CyptoLib 3.1.0 (STM32CryptographicV3.0.0_CM4_IAR_otnsc.a) with IAR compiler. Up to version 8.10 of the IAR compiler I never had any warning or error during the build of the project. Upgrading the IAR IDE to version 8.11 I have this error:

"Warning[Lt009]: Inconsistent wchar_t size
crypto.o(STM32CryptographicV3.0.0_CM4_IAR_otnsc.a) has wchar_t size 16 bits "
Reading the release notes of the IAR 8.11 I found this:

 

IAR Information Center for ARM

  • Changed size of wchar_t in version 8.10 and 8.11

    Object files following the ARM ABI has a runtime attribute indicating the size of wchar_t.

    In EWARM version 7.80 and earlier, the size of wchar_t was 2 bytes wide and the runtime attribute was set accordingly.

    For EWARM version 8.10, the size of wchar_t was 4 bytes wide but the value of the runtime attribute was not updated. Thus in 8.10 code is generated with 4 byte wide wchar_t but the object file is marked as if wchar_t is 2 bytes wide.

    In EWARM version 8.11 wchar_t is 4 bytes wide and the runtime attribute is set accordingly.

    Looking only at the wchar_t aspect this has the following implications:
    • Combining object files built with 7.80 and 8.10 will not trigger any linker warning but if the application uses wchar_t, the behavior will be unpredictable.

    • Combining object files built with 8.10 and 8.11 will trigger a linker warning but the application should work even if it uses wchar_t.

    • Combining object files built with 7.80 and 8.11 will trigger a linker warning and if the application uses wchar_t, the behavior will be unpredictable.

Then, by this description, the CryptoLib 3.1.0 needs to be rebuilded with new version of the compiler to avoid unpredictable issues.

 

I planned a new release of the Crytolib compiled with IAR 8.11? 

How I can solve this issue?

Thanks

Outcomes