warning:assignment makes pointer from integer without a cast

前端 未结 2 453
孤城傲影
孤城傲影 2021-01-15 06:10

Its quite a common question but I have not got my answer so asking it again.

I have structers defined as:

struct f_lock{
              int x;
                


        
2条回答
  •  野的像风
    2021-01-15 07:15

    Did you also get the error implicit declaration of function ‘new_node’? Because in that case, you probably forgot to declare new_node in the module where you're calling it. (If you're not getting that error, recompile with -Wall to turn more warnings on.)

    Explanation of the warning message: if new_node has not been declared properly, the compiler will assume it returns int, which is a kind of default return type (for historical reasons).

提交回复
热议问题