Module Name:    src
Committed By:   pooka
Date:           Tue Jul 16 21:14:42 UTC 2013

Modified Files:
        src/sys/rump/net/lib/libvirtif: rumpcomp_user.c

Log Message:
A simple (void) is apparently too easy and traditional to make
Wunused-result STFU, so let's invent something a bit more verbose to
try to achieve the desired result of "ccg xnaht I really don't care if
you think I should check the return value".


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/rumpcomp_user.c
diff -u src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.9 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.10
--- src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.9	Tue Jul 16 19:44:31 2013
+++ src/sys/rump/net/lib/libvirtif/rumpcomp_user.c	Tue Jul 16 21:14:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcomp_user.c,v 1.9 2013/07/16 19:44:31 pooka Exp $	*/
+/*	$NetBSD: rumpcomp_user.c,v 1.10 2013/07/16 21:14:42 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -132,9 +132,19 @@ VIFHYPER_SEND(struct virtif_user *viu,
 	struct iovec *iov, size_t iovlen)
 {
 	void *cookie = rumpuser_component_unschedule();
+	ssize_t idontcare __attribute__((__unused__));
 
-	/* no need to check for return value; packets may be dropped */
-	(void)writev(viu->viu_fd, iov, iovlen);
+	/*
+	 * no need to check for return value; packets may be dropped
+	 *
+	 * ... sorry, I spoke too soon.  We need to check it because
+	 * apparently gcc reinvented const poisoning and it's very
+	 * hard to say "thanks, I know I'm not using the result,
+	 * but please STFU and let's get on with something useful".
+	 * So let's trick gcc into letting us share the compiler
+	 * experience.
+	 */
+	idontcare = writev(viu->viu_fd, iov, iovlen);
 
 	rumpuser_component_schedule(cookie);
 }

Reply via email to