]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Supercede b9076 & b9079: old compiler support
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 15 Jul 2008 11:42:48 +0000 (23:42 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 15 Jul 2008 11:42:48 +0000 (23:42 +1200)
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.

lib/util.c
src/StoreIOBuffer.h
src/comm.cc
src/tools.cc

index 4e7ec2518a12ad7c8a90bc24f77d8159f8941951..8f48a267f4cab8a573e1251262f52a1f6be22e0d 100644 (file)
@@ -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();
 }
 
index 16a4c4db4a1af8bab2a8e28d86087596c25a44e5..830385f03136016da60ab4f8c4264fbdad723b84 100644 (file)
@@ -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
index ae52476cf7ccb0f261d2d3f959cc783bd6ece619..bc5cb449182be46cce553241e365741bb52e859e 100644 (file)
@@ -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");
index a93618c409160a3110d8ea35fba579a1ba9699ed..e298cf1a59a4f0dbc2de33a846cd07d8c9d00545 100644 (file)
@@ -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);
 }