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
  • 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! ;-)

Reply
  • 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! ;-)

Children
No data