Re: [RFC][PATCH] notmuch: Workaround to allow ignoring non-void function return.
authorDavid Edmondson <dme@dme.org>
Thu, 22 Dec 2011 19:25:59 +0000 (19:25 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:12 +0000 (09:41 -0800)
6f/b434a87d807fc2c2be9624086c903bd7c288cf [new file with mode: 0644]

diff --git a/6f/b434a87d807fc2c2be9624086c903bd7c288cf b/6f/b434a87d807fc2c2be9624086c903bd7c288cf
new file mode 100644 (file)
index 0000000..87e28db
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id C8214431FD0\r
+       for <notmuch@notmuchmail.org>; Thu, 22 Dec 2011 11:26:10 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ks22cHkMpbJE for <notmuch@notmuchmail.org>;\r
+       Thu, 22 Dec 2011 11:26:10 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 2F5E8431FB6   for <notmuch@notmuchmail.org>; Thu, 22 Dec 2011 11:26:10 -0800\r
+ (PST)\r
+Received: by wgbds13 with SMTP id ds13so13454952wgb.2\r
+       for <notmuch@notmuchmail.org>; Thu, 22 Dec 2011 11:26:07 -0800 (PST)\r
+Received: by 10.227.198.142 with SMTP id eo14mr11556285wbb.28.1324581967582;\r
+       Thu, 22 Dec 2011 11:26:07 -0800 (PST)\r
+Received: from hotblack-desiato.hh.sledj.net\r
+       (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
+       by mx.google.com with ESMTPS id dd4sm25033396wib.1.2011.12.22.11.26.05\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 22 Dec 2011 11:26:06 -0800 (PST)\r
+Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
+       id 165AC9FBB6; Thu, 22 Dec 2011 19:26:04 +0000 (GMT)\r
+To: Austin Clements <amdragon@MIT.EDU>\r
+Subject: Re: [RFC][PATCH] notmuch: Workaround to allow ignoring non-void\r
+       function return.\r
+In-Reply-To: <20111222190305.GA324@mit.edu>\r
+References: <1324503532-5799-1-git-send-email-dme@dme.org>\r
+       <20111222070345.GI10376@mit.edu>\r
+       <cunfwgdvzpy.fsf@hotblack-desiato.hh.sledj.net>\r
+       <20111222190305.GA324@mit.edu>\r
+User-Agent: Notmuch/0.10.2+107~ga2d0215 (http://notmuchmail.org)\r
+       Emacs/24.0.92.1 (x86_64-pc-linux-gnu)\r
+From: David Edmondson <dme@dme.org>\r
+Date: Thu, 22 Dec 2011 19:25:59 +0000\r
+Message-ID: <cuny5u4v260.fsf@hotblack-desiato.hh.sledj.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 22 Dec 2011 19:26:10 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Thu, 22 Dec 2011 14:03:05 -0500, Austin Clements <amdragon@MIT.EDU> wrot=\r
+e:\r
+> > In general I agree, but what would we do if writing an error message to\r
+> > stderr fails?\r
+>=20\r
+> This was discussed on IRC, but calls to write(2) should never be bare.\r
+> I believe it's marked warn_unused_result not because libc is so\r
+> concerned with people checking for error returns (otherwise all sorts\r
+> of things would be marked warn_unused_result) but because even a\r
+> successful write can be a short write.  Hence, not checking the result\r
+> is a bug, even if you don't care about errors.\r
+\r
+As I said, the principle is sound. What would do in this specific case?\r
+\r
+static void\r
+handle_sigint (unused (int sig))\r
+{\r
+    static char msg[] =3D "Stopping...         \n";\r
+\r
+    write(2, msg, sizeof(msg)-1);\r
+    interrupted =3D 1;\r
+}\r
+\r
+Just this?\r
+\r
+     if (write(2, msg, sizeof(msg)-1) {\r
+        /* Appease the compiler. */;\r
+     }\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.11 (GNU/Linux)\r
+\r
+iEYEARECAAYFAk7zhEcACgkQaezQq/BJZRb5sgCeKPmw3UKPGWKTOOdvLd++mdzi\r
+awYAnRhOee2FLXQ5B/kilH9RWbxL/Nn6\r
+=a06T\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r