“warning: initialization makes pointer from integer without a cast”. But I don't think it does

核能气质少年 提交于 2019-12-05 21:09:15

If it's pure C, isn't there a warning about 'unknown' function? if yes, then the compiler decides that the unknown function returns int, and continues on.. check if proper headers are included, and the function is declared before it's used.

Found the answer, as per this. I wasn't referencing the header file containing the function prototype. So, as I understand it, the compiler was guessing at the function's type signature, and guessing the return type as the default int.

It all worked because the implementation file containing the function was included in the build and the return type (assumed to be an int) was just placed in a variable declared as a pointer.

Is the function generateLoggingSmfReaderCallback or generateLoggingCallback? If the function name in the prototype does not match the one in your call, the strange thing then is only that you are not getting the warning on each build.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!