It looks as if the function call returns an unintended value.

Answer

  • This problem can be caused by the wrong function prototype or if types of some or all arguments passed by a function call are different from the types of corresponding arguments in the function declaration. In these cases, warning messages are returned from C compiler and you should be careful about the messages.
  • You should be careful about "implicit function declaration". Calling a function without a function prototype will process all the arguments and return the value of the function as int. Warning message for a function call without a function prototype will be suppressed unless the higher warning level options are specified. So, it may easily happen that the "implicit function declaration" is overlooked.

(2015/11/17)