This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Lx51 "Data Type Different" Warnings ?

Hello.

I have a project that links to a library I created using the C51 toolset.

If I build it using BL51, everything's cool. If I build it with Lx51, I get warnings like this:

*** WARNING L25: DATA TYPES DIFFERENT
    SYMBOL:  _FnName
    MODULE:  .\main.obj (MAIN)
though the application appears to work just fine in the simulator.

If I build the project with source files only (i.e. I compile the modules that are normally in the library, and I don't link to the library) then everything works under BL51 and Lx51.

So, what can I do to enable me to build projects using Lx51 and my libraries, and avoid these "Data Type Different" Warnings?

Parents
  • OK, I have solved the original problem.

    Certain compilers (which shall remain nameless, but are not Keil competitors because they serve a different target market) require that external array references include the size of the array in them (!), e.g.:

    extern OStypeEcb OSecbArea[5];
    instead of the more common (and more desireable, to be sure)
    extern OStypeEcb OSecbArea[];
    which is the way Keil C51 works.

    Anyway, this declaration was causing problems, because the libraries had been compiled for a particular size array (e.g. 5), yet the local module (in source code) that actually defined the array and therefore overrode what was in the library was set to a different size (e.g. 1) in order to minimize RAM requirements. Once the numbers matched, then all problems disappeared.

    So, the lesson is to always use the more general form of the external declaration
    extern type ArrayName[];
    and you'll avoid all of these problems.

    Regards,

Reply
  • OK, I have solved the original problem.

    Certain compilers (which shall remain nameless, but are not Keil competitors because they serve a different target market) require that external array references include the size of the array in them (!), e.g.:

    extern OStypeEcb OSecbArea[5];
    instead of the more common (and more desireable, to be sure)
    extern OStypeEcb OSecbArea[];
    which is the way Keil C51 works.

    Anyway, this declaration was causing problems, because the libraries had been compiled for a particular size array (e.g. 5), yet the local module (in source code) that actually defined the array and therefore overrode what was in the library was set to a different size (e.g. 1) in order to minimize RAM requirements. Once the numbers matched, then all problems disappeared.

    So, the lesson is to always use the more general form of the external declaration
    extern type ArrayName[];
    and you'll avoid all of these problems.

    Regards,

Children