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

DATA TYPES DIFFERENT warning with pointers -- why?

Code (Salvo) compiles fine under Cx51, but results in a WARNING L25: DATA TYPES DIFFERENT message when compiled under C-ARM. This only affects pointers (they're all pointers to structs), where they're declared in one module (mem.c) and accessed in another (init.c) via extern declarations.

Compile options on both files are the same, no other issues.

I've seen (and resolved) this sort of problem before in Cx51 when there was a mismatch between a source file and a library I had generated. In this case, there's just two source files involved, so I'm a bit stumped.

Can anyone help?

Thanks,

Parents
  • "where they're declared in one module (mem.c) and accessed in another (init.c) via extern declarations."

    Just to get this precise, you mean they're defined in mem.c, and accessed via extern declarations in init.c?

    You could try removing the extern declarations from init.c and putting them into, say, mem.h instead - then #include mem.h in both mem.c and init.c.
    That way, the compiler gets to "see" both the declarations and the definitions when it compiles mem.c - and will be able to warn of any mismatches

Reply
  • "where they're declared in one module (mem.c) and accessed in another (init.c) via extern declarations."

    Just to get this precise, you mean they're defined in mem.c, and accessed via extern declarations in init.c?

    You could try removing the extern declarations from init.c and putting them into, say, mem.h instead - then #include mem.h in both mem.c and init.c.
    That way, the compiler gets to "see" both the declarations and the definitions when it compiles mem.c - and will be able to warn of any mismatches

Children