Warning: [#167-D] Argument of type <type *> is incompatible with parameter of type <type>10/10/2016 SRC\file.c:279: warning: [#167-D] argument of type <type *> is incompatible with parameter of type <type> Reason: You are trying to assign an address to a value of type pointer as an actual value or vice-a-versa. Example: uint8* pvar; /* pvar is a pointer*/ void function func( void ) { uint8 uvar; /* uvar is uint8*/ uvar = pvar; /* wrong assignent of pointer to uint*/ /* or */ pvar = uvar; /* wrong assignment of uint to pointer */ } Problem: In case you are intentionally doing this you need to typecast this action "variable = (uint8) pointer;". This is more readable and remover warning. In case you don't wanted to do it your code will use address instead of value (endless loops/wrong calculations) or vise-a-versa use actual value as an address, which is more dangerous (read from worng location, write to wrong location (compromise memory consistency), jump to wrong code). This is much more harder to debug if you don't pay attention to warnings. If this is a part of function call where you need to change the type of function parameter, then don't forget to change this type in function prototype also.
0 Comments
Your comment will be posted after it is approved.
Leave a Reply. |
AuthorWarnings are important! Archives
May 2017
Categories |