Compiler warning

This is a discussion on Compiler warning within the C Programming forums, part of the General Programming Boards category; Hello all, I am currently programming a microcontroller in c. I am using uVision as IDE and Realview as the ...

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    1

    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

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,747
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 02:30 PM
  2. Replies: 28
    Last Post: 07-17-2006, 12:35 AM
  3. compiler warning message
    By alice in forum C Programming
    Replies: 2
    Last Post: 04-18-2004, 01:53 PM
  4. bcc32 compiler warning when assigning null to pointer
    By finnepower in forum C++ Programming
    Replies: 4
    Last Post: 06-25-2002, 12:37 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 06:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21