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

warning correction help

openPOWERLINK_v1.1.0\EplStack\EplApiGeneric.c(1648): warning:  #68-D: integer conversion resulted in a change of sign

The parameter is usually assigned a dword value, but when, on initiation of the code, it is assigned a -1, the program should assign the parameter with a default value which is stored in an object dictionary.

if (EplApiInstance_g.m_InitParam.m_dwCycleLen != -1)

m_dwCycleLen is a DWORD. How can I remove the warning?

Parents Reply Children
  • Ok great, thank you for your help!!<p>

    It's sometimes considered bad style to have variables that "usually" contain a value but "occasionally" have "special" values that are not used as the value.

    One way to avoid this would be to have a second variable that explicitly indicates how to initialize the first.

    If you want to keep the "special meaning" construction, use a positive value as this "special" meaning, _and_ use a define for this value to get rid of the "magic number". (e.g. #define INIT_VAR_FROM_ROM 0xFFFFFFFF)