Library built with 7.xx causes warning message in 8.11

Technical Note 20171003

Arkitekturer:

Arm

Komponent:

linker

Uppdaterad:

2017-10-03 14:48

Introduction 

Because both the size and the internal encoding of wchar_t are different between IAR Embedded Workbench for Arm version 7.xx and version 8.11 or later, the linker message

Warning [Lt009]: Inconsistent wchar_t size

will be generated when a library built with version 7.xx is used in version 8.11 or later.

Discussion

In IAR Embedded Workbench for Arm version 7.80 and earlier, the size of wchar_t was two bytes and in version 8.11 the size of wchar_t is four bytes. Moreover the internal encoding of wchar_t objects between these versions objects is different.

This means that combining object files built with versions7.80 and 8.11 will generate a linker warning if the application uses wchar_t, the behavior will be unpredictable. In general, we strongly recommend using object code from one version only, and for a major upgrade such as 7.8 to 8.11, all code should be rebuilt.

If you choose to not to rebuilt, you should at least do following actions:

  1. a)    Rebuild an object code build with version 7.xx and written in C++.
  2. b)    If the library does include wchar_t, rebuild the library with version 8.11.
  3. c)    If a library built with version 7.xx does not include wchar_t, and an application built with version 8.11 (or later) in fact works as expected, you might want to ignore the warning message. To suppress the warning message, do this:
    1. Choose Project>Options>Linker>Diagnostics
    2. Select Suppress these diagnostics  and specify: Lt009
    3. Click OK.

Note1: If you later add another 7.xx library to your 8.11(or later) project, please remove the suppress diagnostic option described above (“Lt009”) and go through steps a-c again.

Conclusion

A library that uses wchar_t built with IAR Embedded Workbench for Arm version 7.xx must be rebuilt to be used with version 8.11.

 

All product names are trademarks or registered trademarks of their respective owners.

Det här innehållet finns tyvärr inte på svenska.

Vår webbplats finns främst på vårt koncernspråk engelska, förutom det innehåll för investerare som vi är lagstadgade att kommunicera på svenska. Vi rekommenderar att du besöker vår globala webbplats på engelska för att få en bättre upplevelse.

Vi stöder inte längre Internet Explorer. För att få bästa möjliga upplevelse av iar.com rekommenderar vi att du uppgraderar till en modern webbläsare som Chrome eller Edge.