lint produces some warning like:
foo.c XXX Warning 534: Ignoring return value of function bar()
From the lint manual
I solved the problem like this:
#define ignore_result(x) if (x) {}
then instead of (void)foo() use ignore_result(foo())
(void)foo()
ignore_result(foo())
Then the code compiles with -Wall just fine.
-Wall