(void)foo() means that we ignore the return value of the call to foo (in this case, printf ).
Depending on the compiler and the warning level set, ignoring the return value, a warning is raised. Sometimes people use the "treat warnings as errors" parameter for the compiler, and then to compile the code, the return value of the called functions must either be used or explicitly ignored, as in this case.
This is not required in a normal setup, only if the settings are very strict.
source share