To get rid of a warn_unused_result warning in gcc, wrap the code with if(). Example:
if (write(a, b, c) < 0) { }