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

__C51__ undefined in uV4?

I wrote and debugged a project on a workstation running uV3
(V3.30a) a while back. It contains a file that must be
shared with other (von Neumann) processors that do not use
Keil development tools and contains a pre-processor
construct for the definition of an object:

  #if defined(__C51__)
    struct unsMsgSpec const code sysParmTable[] = {
  #else
    struct unsMsgSpec const      sysParmTable[] = {
  #endif

that eliminates the non-ANSI reserved word when running on
non-Keil translators.

This same macro is used to declare the object in a header
file:

  #if defined(__C51__)
    extern struct unsMsgSpec const code sysParmTable[];

  #else
    extern struct unsMsgSpec const      sysParmTable[];

  #endif

The source file that defines the object and the header that
declares it are in the parent directory, beneath which are
project directories for the several micros that must co-
operate to run this embedded device.

The source module that references the 'sysParmTable[]'
object pulls in the same header file:

  #include "..\UnistarProtocol.h" /* CAN queries      */

from its parent directory. As coded, it builds and links
without error or warning on uV3.

I am attempting to hand it off to a co-worker who has uV4
(V4.60.6.10) on another workstation. During the link step of
the build, this object generates an error:

*** ERROR L103: EXTERNAL ATTRIBUT DO NOT MATCH PUBLIC
    SYMBOL:  SYSPARMTABLE
    MODULE:  .\Debug\UnistarProtocol.obj (UNISTARPROTOCOL)

When I look at the pre-processor output for this object (in
the module where it is defined), I see:

 extern struct unsMsgSpec const  sysParmTable[];

and

 struct unsMsgSpec const  sysParmTable[] = {

whereas, in the module where it is referenced, I see:

 extern struct unsMsgSpec const code sysParmTable[];

It appears that the definition of __C51__ has become
context-sensitive in uV4. Am I missing something?

============================================================
Gary Lynch    printf("lynchg%cstacoenergy%ccom", 55+9, 55-9)
============================================================

0