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