我在 Solaris 中编译了一个 C 程序并收到此警告。
line 68: warning: improper pointer/integer combination: op "="
我的代码包含
struct cmsghdr  *cmsg;
第 68 行是
cmsg = CMSG_FIRSTHDR(&msg);
结构 cmsghdr 和 CMSG_FIRSTHDR 在 socket.h 中定义为
#define  CMSG_FIRSTHDR(m)
--
--
struct cmsghdr {
        socklen_t       cmsg_len;  
        int             cmsg_level;
        int             cmsg_type; 
};
我在我的代码中包含了 socket.h。但我仍然收到此错误。