We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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!
don't use #define DWORD unsigned long but use DWORD, i think that is pre-define type
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.
however, if i do not use DWORD, i cannot compile my source codes.! Lu Yunfeng
1) cannot use typedef; 2) after i change DWORD into UWORD, the warnning disappers! thanks, Lu Yunfeng
1) cannot use typedef; Why not? 2) after i change DWORD into UWORD, the warnning disappers! Of course it does - you are no longer in conflict with Keil's DWORD I still recommend that you should avoid "WORD" as it is ambiguous; U32 tells you unambiguously (and fairly intuitively) that it's Unsigned and 32 bits. And it's shorter to type into the bargain! ;-)