gpt4 book ai didi

c - int 深度 UNUSED_PARAM

转载 作者:行者123 更新时间:2023-11-30 14:29:18 29 4
gpt4 key购买 nike

static FAST_FUNC int fileAction(const char *pathname,
struct stat *sb UNUSED_PARAM,
void *modname_to_match,
int depth UNUSED_PARAM){...}

“int深度UNUSED_PARAM”是什么意思?

最佳答案

来自 Busybox-1.18.3 中的 include/platform.h:

#define UNUSED_PARAM __attribute__ ((__unused__))

来自GCC documentation :

unused
This attribute, attached to a variable, means that the variable is meant to be possibly unused. GCC will not produce a warning for this variable.

所以,这只是告诉人类程序员和编译器该变量不一定被使用的一种方式。否则,编译器可能会警告您有关未使用的变量。

据推测,fileAction 需要 深度 参数与函数指针类型或其他 API 约束兼容,但 fileAction 实际上并未使用参数。

关于c - int 深度 UNUSED_PARAM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4954911/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com