int depth UNUSED_PARAM
static FAST_FUNC int fileAction(const ch开发者_如何学Goar *pathname,
struct stat *sb UNUSED_PARAM,
void *modname_to_match,
int depth UNUSED_PARAM){...}
what does "int depth UNUSED_PARAM" mean ?
From include/platform.h
in Busybox-1.18.3:
#define UNUSED_PARAM __attribute__ ((__unused__))
And from the 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.
So, it is just a way to tell both the human programmers and the compiler that the variable is not necessarily used. Otherwise, the compiler may warn you about an unused variable.
Presumably, fileAction
requires the depth
parameter to be compatible with a function pointer type or other API constraints but fileAction
doesn't actually use the parameter.
精彩评论