Re: [notmuch] [PATCH] fix compiler warnings
authorCarl Worth <cworth@cworth.org>
Mon, 23 Nov 2009 03:22:07 +0000 (04:22 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:40 +0000 (09:35 -0800)
b2/d3b9e31332ce2f99ba8e483594141f77f5eac8 [new file with mode: 0644]

diff --git a/b2/d3b9e31332ce2f99ba8e483594141f77f5eac8 b/b2/d3b9e31332ce2f99ba8e483594141f77f5eac8
new file mode 100644 (file)
index 0000000..8625e6a
--- /dev/null
@@ -0,0 +1,63 @@
+Return-Path: <cworth@cworth.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 4113F431FBF;\r
+       Sun, 22 Nov 2009 19:22:23 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 aLx7U7PeLLRP; Sun, 22 Nov 2009 19:22:22 -0800 (PST)\r
+Received: from cworth.org (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 302F2431FAE;\r
+       Sun, 22 Nov 2009 19:22:22 -0800 (PST)\r
+From: Carl Worth <cworth@cworth.org>\r
+To: djcb@djcbsoftware.nl, "notmuch\@notmuchmail org" <notmuch@notmuchmail.org>\r
+In-Reply-To: <87d43ay4qg.wl%djcb@djcbsoftware.nl>\r
+References: <87d43ay4qg.wl%djcb@djcbsoftware.nl>\r
+Date: Mon, 23 Nov 2009 04:22:07 +0100\r
+Message-ID: <87vdh2exi8.fsf@yoom.home.cworth.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: Re: [notmuch] [PATCH] fix compiler warnings\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\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: Mon, 23 Nov 2009 03:22:23 -0000\r
+\r
+On Sun, 22 Nov 2009 17:11:03 +0200, Dirk-Jan C. Binnema <djcb.bulk@gmail.com> wrote:\r
+> \r
+> (hopefully this is the correct way to send patches...)\r
+\r
+Looks just fine, and welcome to notmuch!\r
+\r
+> With these minor changes, notmuch compiles warning-free with gcc 4.4.1\r
+\r
+Could you resend these as separate patches, each patch fixing a single\r
+type of warning? That would make it more clear what the code is doing.\r
+\r
+> -    write(2, msg, sizeof(msg)-1);\r
+> +    if (write(2, msg, sizeof(msg)-1) < 0) {\r
+> +        /* ignore...*/\r
+> +    }\r
+\r
+I don't like the gratuitous conditional here. It clutters the code and\r
+make is less clear. If we're just trying to squelch a warning about an\r
+unused return value from a function, then I think I'd rather see:\r
+\r
+       ssize_t ignored;\r
+\r
+        ignored = write (2, msg, sizeof (msg) - 1);\r
+\r
+What do you think?\r
+\r
+-Carl\r