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 BFDA7431FBC for ; Mon, 23 Nov 2009 06:24:18 -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 b0YQhekNKv0l for ; Mon, 23 Nov 2009 06:24:18 -0800 (PST) Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com [209.85.218.210]) by olra.theworths.org (Postfix) with ESMTP id C0E25431FAE for ; Mon, 23 Nov 2009 06:24:17 -0800 (PST) Received: by bwz2 with SMTP id 2so5274215bwz.0 for ; Mon, 23 Nov 2009 06:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :in-reply-to:references:date:message-id:mime-version:content-type; bh=hwDxi7CbZxlHBpyVwsYNPBmR2n4X1ydbCBb2e7bZ6PM=; b=KnoT1DLrgxdUtf2iCIZptkc6UIeKEWrQ36WyoMtjz2MU5ED1xmgt5PJa53hIEHycft 3ve3q8E/L60XdoLgqu+x2voSSd9/4uwoWic6XFommRZvxcGaXkNypXncCwWD7RmXG78I zRojaT1wdXW5Rs1igiUm4/hoj9abjc+0YKda8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; b=EUbqDt+QD6C+cNU0bY2X4ftoZtM1twifbX3H7iyLFldXLG6WNeh2dU9cVuZYqrTleq CcZ+Fh026Ag+sA/hrHhB620bj7jUeEaUoD3m/ZYrKSOLM/zCLM35JUWi6qpafh1Gwxht VZZV7ho2ZShrt3knPPs3GRyRElrbK2nvprdPs= Received: by 10.204.2.73 with SMTP id 9mr4687447bki.159.1258986256520; Mon, 23 Nov 2009 06:24:16 -0800 (PST) Received: from kunyang (vawpc43.ethz.ch [129.132.59.11]) by mx.google.com with ESMTPS id 31sm5790992fkt.1.2009.11.23.06.24.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 23 Nov 2009 06:24:15 -0800 (PST) Sender: Jed Brown From: Jed Brown To: Karl Wiberg , Dirk-Jan Binnema In-Reply-To: References: <87skc5yd6v.wl%djcb@djcbsoftware.nl> <1873022c0911230311o77e55fdqa5464a2dd16ec265@mail.gmail.com> Date: Mon, 23 Nov 2009 15:24:46 +0100 Message-ID: <87ws1h48up.fsf@59A2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "notmuch@notmuchmail org" , djcb@djcbsoftware.nl Subject: Re: [notmuch] [PATCH 1/2] * avoid gcc 4.4.1 compiler warnings due to ignored write return values 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 14:24:18 -0000 On Mon, 23 Nov 2009 14:19:18 +0100, Karl Wiberg wrote: > On Mon, Nov 23, 2009 at 12:11 PM, Dirk-Jan Binnema wrote: > > > On Mon, Nov 23, 2009 at 9:34 AM, Karl Wiberg wrote: > > > > > Didn't the "(void)" suggestion work? > > > > I actually preferred that solution, but unfortunately, it didn't > > stop gcc from complaining... > > Hmpf. I'd argue that that's a gcc bug, forcing the user to use an > unnecessarily complicated way to pretend to use the return value. Oh > well. >From the gcc man page: -Wunused-value Warn whenever a statement computes a result that is explicitly not used. To suppress this warning cast the unused expression to void. This includes an expression-statement or the left- hand side of a comma expression that contains no side effects. For example, an expression such as x[i,j] will cause a warning, while x[(void)i,j] will not. This warning is enabled by -Wall. But I'm confused here because I don't currently see any warnings with gcc-4.4.2. Actually this must be a bug because I get no warnings for the blatantly unused malloc(5); with -Wall -Wextra -pedantic. Anyway, if your system headers specify __attribute__((warn_unused_result)) for write, then you could be running into this bug/feature http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35579 Jed