What does (void)var actually do?
问题 Consider the following main() : int main(int argc, char *argv[]) { return (0); } Upon compilation with cc -Wall -Wextra , warnings saying "unused parameter" get generated. When I do not need to use a parameter in a function (for instance in a signal handler function that makes no use of its int parameter), I am used to doing the following: int main(int argc, char *argv[]) { (void)argc; (void)argv; return (0); } (For that particular main() , I sometimes see other people do: argv = argv - argc