fuse

What does (void) 'variable name' do at the beginning of a C function? [duplicate]

别来无恙 提交于 2019-11-27 11:18:21
This question already has an answer here: Why cast an unused function parameter value to void? 2 answers I am reading this sample code from FUSE: http://fuse.sourceforge.net/helloworld.html And I am having trouble understanding what the following snippet of code does: static int hello_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) { (void) offset; (void) fi; Specifically, the (void) "variable name" thing. I have never seen this kind of construct in a C program before, so I don't even know what to put into the Google search box. My current

What does (void) 'variable name' do at the beginning of a C function? [duplicate]

让人想犯罪 __ 提交于 2019-11-26 15:30:50
问题 This question already has answers here : Why cast an unused function parameter value to void? (2 answers) Closed 2 years ago . I am reading this sample code from FUSE: http://fuse.sourceforge.net/helloworld.html And I am having trouble understanding what the following snippet of code does: static int hello_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) { (void) offset; (void) fi; Specifically, the (void) "variable name" thing. I have