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)
OK, I think I solved this particular problem -- looks like LIBX51.EXE is required to build libraries for C51+OMF2 directive or CX51. This wasn't entirely clear from the manual, but in hindsight I guess it makes sense. P.S. There's a typo on page 17 of the Cx51 Manual -- 2nd-to-last line should read "... C51 compiler that is designed for the new Philips ..." Regards,
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];
extern OStypeEcb OSecbArea[];
extern type ArrayName[];
Does this compiler do array bounds checking? I s'pose that might be a reason for it to want the size
If my compiler did array bounds checking, I would shoot it! I use negative array indexing all the time for useful kinds of stuff. Jon
Andrew asked "Does this compiler do array bounds checking?" Probably. Our arrays in question are arrays of struct, and all access is through pointers. Does the ANSI C standard say anything about this issue (how to declare extern arrays)?