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 BE81F407696 for ; Sat, 7 Jan 2012 15:26:43 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled 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 LmtA3iUQ1m5z for ; Sat, 7 Jan 2012 15:26:42 -0800 (PST) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7611D40EEF9 for ; Sat, 7 Jan 2012 15:26:40 -0800 (PST) Received: by mail-ee0-f53.google.com with SMTP id d41so2133471eek.26 for ; Sat, 07 Jan 2012 15:26:40 -0800 (PST) Received: by 10.14.127.197 with SMTP id d45mr4259255eei.91.1325978800065; Sat, 07 Jan 2012 15:26:40 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id y12sm267561571eeb.11.2012.01.07.15.26.38 (version=SSLv3 cipher=OTHER); Sat, 07 Jan 2012 15:26:39 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [RFC PATCH 4/9] lib: HACK: avoid warnings from talloc_steal() Date: Sun, 8 Jan 2012 01:26:18 +0200 Message-Id: <4f8dac27c84d35c51f692f2589cacb2a06da554b.1325977940.git.jani@nikula.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Sat, 07 Jan 2012 23:26:44 -0000 talloc.h #defines talloc_steal() with macros to make it type safe, but introduces a warning when compiled using -std=c99 -pedantic: lib/tags.c: In function ‘_notmuch_tags_create’: lib/tags.c:43:5: warning: ISO C forbids braced-groups within expressions [-pedantic] Call _talloc_steal_loc() directly without the macro wrapper. We aren't even interested in the return value the macro is so hard trying to provide type safety for. Signed-off-by: Jani Nikula --- lib/tags.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lib/tags.c b/lib/tags.c index c58924f..56c43e2 100644 --- a/lib/tags.c +++ b/lib/tags.c @@ -40,7 +40,10 @@ _notmuch_tags_create (const void *ctx, notmuch_string_list_t *list) return NULL; tags->iterator = list->head; - talloc_steal (tags, list); + + /* _talloc_steal_loc() is talloc_steal() without macro wrapping to avoid + * -std=c99 -pedantic warning. __location__ is defined in talloc.h. */ + _talloc_steal_loc (tags, list, __location__); return tags; } -- 1.7.5.4