Thread: Compiler warning

  1. #1
    Registered User
    Join Date
    Nov 2008

    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:
    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:
    EPL_OBD_BEGIN_INDEX_RAM(0x1000, 0x01, NULL)
         EPL_OBD_SUBINDEX_RAM_VAR(0x1000, 0x00, 0x07, 0x01, tEplObdUnsigned32, NMT_DeviceType_U32, 0xF0191)
    and finally the definition of EPL_OBS_SUBINDEX_RAM_VAR:
    #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:
    typedef unsigned long       tEplObdUnsigned32;   // 0007
       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

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Toronto, ON
    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 am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    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).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  2. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  3. compiler warning message
    By alice in forum C Programming
    Replies: 2
    Last Post: 04-18-2004, 12:53 PM
  4. bcc32 compiler warning when assigning null to pointer
    By finnepower in forum C++ Programming
    Replies: 4
    Last Post: 06-25-2002, 11:37 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM