]> git.tuebingen.mpg.de Git - paraslash.git/commit
udp_send: Silence gcc warning.
authorAndre Noll <maan@systemlinux.org>
Thu, 24 Mar 2011 12:05:49 +0000 (13:05 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 24 Mar 2011 12:05:49 +0000 (13:05 +0100)
commite9c51d24b1667b94101bf52fbd95aa7f1c6cb1d6
tree5e37215892d23f3f5972157ebe477815bfcf6470
parent432c494434722b8dd590f712e5298ff7fb6a6719
udp_send: Silence gcc warning.

Ubuntu Lucid's gcc-4.3.3 emits the following warning about not checking
the return value of write() even if the result is casted to void.

udp_send.c: In function ‘udp_close_target’:
udp_send.c:65: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result

The usual approach to store the return value in a dummy variable is
not optimal because the upcoming gcc-4.6 will warn that the variable
is set but otherwise unused.

Likely there are more places in the paraslash code which have the same
problem, so this patch introduce the do_nothing macro in para.h which,
creatively enough, does nothing. The new macro is employed like

if (write(...))
do_nothing;

This gets rid of the warning on Lucid and does not give new warning
on gcc-4.6.
para.h
udp_send.c