编译还剩最后一个错误
static inline char * __attribute__((warn_unused_result)) __ul_returns_nonnullxstrndup(const char *str, size_t size)
{
char *ret;
if (!str)
return NULL;
// 这个是什么错误 ret = strndup(str, size);
if (!ret)
err(XALLOC_EXIT_CODE, "cannot duplicate string");
return ret;
}
gcc -c hexdump.c
In file included from hexdump.c:59:0:
xalloc.h: In function 'xstrndup':
xalloc.h:83:15: warning: incompatible implicit declaration of built-in function
'strndup' [enabled by default]
ret = strndup(str, size);