-
Compiler warning
Hello all,
I am currently programming a microcontroller in c. I am using uVision as IDE and Realview as the compiler.
the warning I receive is:
Code:
openPOWERLINK_v1.1.0\EplStack\objdict.h(14): warning: #188-D: enumerated type mixed with another type
the line in question in the code which is bugging:
Code:
EPL_OBD_BEGIN_INDEX_RAM(0x1000, 0x01, NULL)
EPL_OBD_SUBINDEX_RAM_VAR(0x1000, 0x00, 0x07, 0x01, tEplObdUnsigned32, NMT_DeviceType_U32, 0xF0191)
EPL_OBD_END_INDEX(0x1000)
and finally the definition of EPL_OBS_SUBINDEX_RAM_VAR:
Code:
#define EPL_OBD_SUBINDEX_RAM_VAR(ind,sub,typ,acc,dtyp,name,val) static dtyp xDef##ind##_##sub##_g = val;
definitions of the variables inside:
Code:
typedef unsigned long tEplObdUnsigned32; // 0007
Code:
DWORD m_dwDeviceType; // NMT_DeviceType_U32
Please let me know which information I need to give to solve this problem.
Thank you for the help and regards,
Leon Pretorius
-
I think it should be safe to ignore that warning. It's just letting you know something looks a bit weird in your code.
-
I see DWORD and unsigned long.
Where's the enum the message speaks of?
> #define EPL_OBD_SUBINDEX_RAM_VAR(ind,sub,typ,acc,dtyp,name ,val) static dtyp xDef##ind##_##sub##_g = val;
I can see this being a macro expanding to different things at different times (since not all the params are used).
Are you sure you've posted the right expansion for the context in which it is used?
Find out how this works for your compiler
gcc -E prog.c
generates prog.i which is the result of expanding ALL the #include and #define macros.
It's a large file, but helps you understand what you've actually got (and what the compiler proper actually sees).