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

when I use '#define DWORD unsigned long' , why does the compiler give me a warning?

I use the following statement in my include file to define a new data type:
#define DWORD unsigned long

however, the compiler give me the following warning:
Warnning C317:redefinition of macro 'DWORD'. but i never defined it anywhere in my source files!

pls give me some help!

Parents
  • Read the section, "Absolute Memory Access Macros" in the C51 manual!

    BTW: Why are you using #define rather than typedef?

    BTW2: I presume you're doing this to get a compiler-independent 32-bit type?
    However, the name "DWORD" is ambiguous in this application; I would prefer to use a name like "U32" (meaning, "Unsigned 32-bit).
    Just my opinion.

Reply
  • Read the section, "Absolute Memory Access Macros" in the C51 manual!

    BTW: Why are you using #define rather than typedef?

    BTW2: I presume you're doing this to get a compiler-independent 32-bit type?
    However, the name "DWORD" is ambiguous in this application; I would prefer to use a name like "U32" (meaning, "Unsigned 32-bit).
    Just my opinion.

Children