From: Amos Jeffries Date: Tue, 15 Jul 2008 11:42:48 +0000 (+1200) Subject: Supercede b9076 & b9079: old compiler support X-Git-Tag: SQUID_3_1_0_1~49^2~142 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d5da0502376fd802d57f2d23b1cad06309ec52c;p=thirdparty%2Fsquid.git Supercede b9076 & b9079: old compiler support Seems the (void) casting method indicated as the best method to fix unused return warning does not actually work. :-( Of the other approaches, I'm picking this one used previously by the SuSE Linux port of Squid as the cleanest. --- diff --git a/lib/util.c b/lib/util.c index 4e7ec2518a..8f48a267f4 100644 --- a/lib/util.c +++ b/lib/util.c @@ -931,8 +931,8 @@ xint64toa(int64_t num) void default_failure_notify(const char *message) { - (void)write(2, message, strlen(message)); - (void)write(2, "\n", 1); + if(write(2, message, strlen(message))) {} + if(write(2, "\n", 1)) {} abort(); } diff --git a/src/StoreIOBuffer.h b/src/StoreIOBuffer.h index 16a4c4db4a..830385f031 100644 --- a/src/StoreIOBuffer.h +++ b/src/StoreIOBuffer.h @@ -68,8 +68,8 @@ public: void dump() const { - (void)fwrite(data, length, 1, stderr); - (void)fwrite("\n", 1, 1, stderr); + if(fwrite(data, length, 1, stderr)) {} + if(fwrite("\n", 1, 1, stderr)) {} } struct diff --git a/src/comm.cc b/src/comm.cc index ae52476cf7..bc5cb44918 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -2308,7 +2308,7 @@ comm_accept_try(int fd, void *) { void CommIO::Initialise() { /* Initialize done pipe signal */ int DonePipe[2]; - (void)pipe(DonePipe); + if(pipe(DonePipe)) {} DoneFD = DonePipe[1]; DoneReadFD = DonePipe[0]; fd_open(DoneReadFD, FD_PIPE, "async-io completetion event: main"); diff --git a/src/tools.cc b/src/tools.cc index a93618c409..e298cf1a59 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -151,7 +151,7 @@ mail_warranty(void) snprintf(command, 256, "%s %s < %s", Config.EmailProgram, Config.adminEmail, filename); - (void)system(command); /* XXX should avoid system(3) */ + if(system(command)) {} /* XXX should avoid system(3) */ unlink(filename); }