系统:Ubuntu 12.10 GCC: gcc 4.7.2 Glibc:2.15
gcc -Wall -c wrapsock.c -o wrapsock.o
wrapsock.c: 在函数‘Inet6rthspace’中: wrapsock.c:82:2: 警告: 隐式声明函数‘inet6rthspace’ [-Wimplicit-function-declaration]
wrapsock.c: 在函数‘Inet6rthinit’中: wrapsock.c:94:2: 警告: 隐式声明函数‘inet6rthinit’ [-Wimplicit-function-declaration]
wrapsock.c:94:6: 警告: 赋值时将整数赋给指针,未作类型转换 [默认启用]
wrapsock.c: 在函数‘Inet6rthadd’中: wrapsock.c:104:2: 警告: 隐式声明函数‘inet6rthadd’ [-Wimplicit-function-declaration]
wrapsock.c: 在函数‘Inet6rthreverse’中: wrapsock.c:111:2: 警告: 隐式声明函数‘inet6rthreverse’ [-Wimplicit-function-declaration]
wrapsock.c: 在函数‘Inet6rthsegments’中: wrapsock.c:120:2: 警告: 隐式声明函数‘inet6rthsegments’ [-Wimplicit-function-declaration]
wrapsock.c: 在函数‘Inet6rthgetaddr’中: wrapsock.c:132:2: 警告: 隐式声明函数‘inet6rthgetaddr’ [-Wimplicit-function-declaration]
wrapsock.c:132:6: 警告: 赋值时将整数赋给指针,未作类型转换 [默认启用]
可是在 unp.h中明确包含了了<netinet/in.h>
在netinet/in.h中找到如下
576 extern socklent inet6rthspace (int type, int __segments) __THROW;
577 extern void *inet6_rth_init (void *bp, socklent bplen, int __type,
579 extern int inet6rth_add (void *bp, const struct in6_addr *addr) THROW;
580 extern int inet6rthreverse (const void *in, void *out) THROW;
581 extern int inet6rthsegments (const void *bp) __THROW;
582 extern struct in6addr *inet6rth_getaddr (const void *__bp, int __index)
沧海一幻觉