--- /dev/null
+Return-Path: <amdragon@mit.edu>\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 53A9D431FAF\r
+ for <notmuch@notmuchmail.org>; Wed, 11 Apr 2012 14:11:17 -0700 (PDT)\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 rR43GqcxLqgG for <notmuch@notmuchmail.org>;\r
+ Wed, 11 Apr 2012 14:11:16 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
+ [18.9.25.15])\r
+ by olra.theworths.org (Postfix) with ESMTP id A6D3E431FAE\r
+ for <notmuch@notmuchmail.org>; Wed, 11 Apr 2012 14:11:16 -0700 (PDT)\r
+X-AuditID: 1209190f-b7f8a6d000000914-a6-4f85f37497cd\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+ by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id FB.12.02324.473F58F4; Wed, 11 Apr 2012 17:11:16 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q3BLBFVS012680; \r
+ Wed, 11 Apr 2012 17:11:16 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3BLBEIm021678\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Wed, 11 Apr 2012 17:11:14 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1SI4or-000184-Mo; Wed, 11 Apr 2012 17:11:13 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Jani Nikula <jani@nikula.org>, Vladimir Marek <Vladimir.Marek@Oracle.COM>,\r
+ Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH 4/4] Explicitly type void* pointers\r
+In-Reply-To: <87mx6ka8y1.fsf@nikula.org>\r
+References: <1333966665-10469-1-git-send-email-Vladimir.Marek@oracle.com>\r
+ <1333966665-10469-5-git-send-email-Vladimir.Marek@oracle.com>\r
+ <CAB+hUn_QyMAfC1-Dr23T63ObX=cwuBOzcyCi=61w0MtGRMyt2w@mail.gmail.com>\r
+ <20120409181543.GC10554@pub.czech.sun.com>\r
+ <87mx6ka8y1.fsf@nikula.org>\r
+User-Agent: Notmuch/0.12+107~gf2d67c3 (http://notmuchmail.org) Emacs/23.3.1\r
+ (i486-pc-linux-gnu)\r
+Date: Wed, 11 Apr 2012 17:11:13 -0400\r
+Message-ID: <87vcl6nfda.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFnrJIsWRmVeSWpSXmKPExsUixCmqrVvyudXf4NcvIYum6c4W12/OZLbo\r
+ uL2bzYHZ49b91+wez1bdYvb4+PQWSwBzFJdNSmpOZllqkb5dAldG2+yYgqM8FbMPvmJpYGzh\r
+ 6mLk5JAQMJHY+vMyC4QtJnHh3nq2LkYuDiGBfYwS9w49Z4dwNjBKfL9xmRnCOckk8ad1IRNI\r
+ i5DAEkaJzt/SIDabgIbEtv3LGUFsEYE6iZmH3rGB2MIC5hIf/09gBrE5gWomv/nMCtE7mUli\r
+ xj5VEFtUIF5iXcN7sDiLgKrE6UufwebwAp23ufckO4QtKHFy5hOwU5kFtCRu/HvJNIFRYBaS\r
+ 1CwkqQWMTKsYZVNyq3RzEzNzilOTdYuTE/PyUot0TfRyM0v0UlNKNzGCQ1SSfwfjt4NKhxgF\r
+ OBiVeHh3TWj1F2JNLCuuzD3EKMnBpCTK6/keKMSXlJ9SmZFYnBFfVJqTWnyIUYKDWUmE12V2\r
+ i78Qb0piZVVqUT5MSpqDRUmcV03rnZ+QQHpiSWp2ampBahFMVoaDQ0mCd8knoKGCRanpqRVp\r
+ mTklCGkmDk6Q4TxAw+tBaniLCxJzizPTIfKnGBWlxHm7QBICIImM0jy4XlgKecUoDvSKMG8L\r
+ SBUPMP3Adb8CGswENPjzZJCri0sSEVJSDYzZMi8CTs3uvZzBWCX1pMU9r7tJy7L+v9nnjVyH\r
+ 2S/+3V2uuOHu28y11ytM/OSuuT64/KZSmnnxTf0KiZcHd5p/bGu4zbfCfuYGQ61Zf1s3NzNc\r
+ XDP35+bp+22SLgb+28a8q6Li41TG0C8rI/5dn/Czr9Jnx7HrIimbI3N69wp93ibx5OLT776t\r
+ SizFGYmGWsxFxYkAHgFeTfwCAAA=\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: Wed, 11 Apr 2012 21:11:17 -0000\r
+\r
+On Mon, 09 Apr 2012, Jani Nikula <jani@nikula.org> wrote:\r
+> Vladimir Marek <Vladimir.Marek@Oracle.COM> writes:\r
+> I'm throwing in a third alternative below. Does it work for you? I think\r
+> it's both prettier and uglier than the above at the same time! ;)\r
+>\r
+> A middle ground would be to change the callers to use\r
+> "notmuch_talloc_steal", and just #define notmuch_talloc_steal\r
+> talloc_steal if __GNUC__ >= 3.\r
+>\r
+> One could argue upstream talloc should have this, but OTOH it's a C\r
+> library.\r
+>\r
+> BR,\r
+> Jani.\r
+>\r
+>\r
+> diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
+> index ea836f7..83b46e8 100644\r
+> --- a/lib/notmuch-private.h\r
+> +++ b/lib/notmuch-private.h\r
+> @@ -499,4 +499,22 @@ _notmuch_filenames_create (const void *ctx,\r
+> \r
+> NOTMUCH_END_DECLS\r
+> \r
+> +#ifdef __cplusplus\r
+> +/* Implicit typecast from 'void *' to 'T *' is okay in C, but not in\r
+> + * C++. In talloc_steal, an explicit cast is provided for type safety\r
+> + * in some GCC versions. Otherwise, a cast is required. Provide a\r
+> + * template function for this to maintain type safety, and redefine\r
+> + * talloc_steal to use it.\r
+> + */\r
+> +#if !(__GNUC__ >= 3)\r
+> +template <class T>\r
+> +T *notmuch_talloc_steal(const void *new_ctx, const T *ptr)\r
+> +{\r
+> + return static_cast<T*>(talloc_steal(new_ctx, ptr));\r
+> +}\r
+> +#undef talloc_steal\r
+> +#define talloc_steal notmuch_talloc_steal\r
+> +#endif\r
+> +#endif\r
+> +\r
+> #endif\r
+\r
+This looks good to me. I was originally concerned that this depended on\r
+talloc_steal being a macro, but I realized that's not actually the case.\r
+Care to roll a real patch?\r