--- /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 0D1C3431FAF\r
+ for <notmuch@notmuchmail.org>; Thu, 12 Apr 2012 10:57:34 -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 NNtKva1dsRw4 for <notmuch@notmuchmail.org>;\r
+ Thu, 12 Apr 2012 10:57:33 -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 4FE23431FAE\r
+ for <notmuch@notmuchmail.org>; Thu, 12 Apr 2012 10:57:33 -0700 (PDT)\r
+X-AuditID: 1209190f-b7f8a6d000000914-b8-4f87178ca6c5\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+ by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 38.BF.02324.C87178F4; Thu, 12 Apr 2012 13:57:32 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q3CHvVtR014123; \r
+ Thu, 12 Apr 2012 13:57:32 -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 q3CHvUJm010169\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Thu, 12 Apr 2012 13:57:31 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1SIOGv-0004T4-V9; Thu, 12 Apr 2012 13:57:30 -0400\r
+Date: Thu, 12 Apr 2012 13:57:29 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Jani Nikula <jani@nikula.org>\r
+Subject: Re: [PATCH 4/4] Explicitly type void* pointers\r
+Message-ID: <20120412175729.GH13549@mit.edu>\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
+ <87vcl6nfda.fsf@awakening.csail.mit.edu>\r
+ <87aa2hxtrv.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <87aa2hxtrv.fsf@nikula.org>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFuplleLIzCtJLcpLzFFi42IRYrdT1+0Rb/c3OL3BwqJpurPF9ZszmS06\r
+ bu9mc2D2uHX/NbvHs1W3mD0+Pr3FEsAcxWWTkpqTWZZapG+XwJWxpvMZU8Fv4YqZezvZGhh3\r
+ 8XcxcnBICJhI3Pir0MXICWSKSVy4t56ti5GLQ0hgH6PE9tsbmSGcDYwSW+ZeZ4dwTjJJ3P90\r
+ F6psCaPE739dbCD9LAKqEm0Hn7KD2GwCGhLb9i9nBLFFBBQlNp/cD2YzC8RLPLr8hRXEFhYw\r
+ l/j4fwIziM0roCPxbM8yqHVPmCTeNPazQyQEJU7OfMIC0awlcePfSyaQu5kFpCWW/+MACXMC\r
+ 7WrY/4YJxBYVUJGYcnIb2wRGoVlIumch6Z6F0L2AkXkVo2xKbpVubmJmTnFqsm5xcmJeXmqR\r
+ rolebmaJXmpK6SZGUKhzSvLvYPx2UOkQowAHoxIP74tnbf5CrIllxZW5hxglOZiURHk/C7X7\r
+ C/El5adUZiQWZ8QXleakFh9ilOBgVhLh/fMYqJw3JbGyKrUoHyYlzcGiJM6rpvXOT0ggPbEk\r
+ NTs1tSC1CCYrw8GhJMH7HWSoYFFqempFWmZOCUKaiYMTZDgP0PDVIDW8xQWJucWZ6RD5U4yK\r
+ UuK8/MJACQGQREZpHlwvLBW9YhQHekWY9z1IOw8wjcF1vwIazAQ0mE8B5OrikkSElFQDo+hJ\r
+ lomBsqpXDGvmhEycfn7zrxBVe7+Eu0YTludN05/NPPnihmAJl7JbR8MnTj5ZuXJ1ZZ2i9cR9\r
+ 997UT3mWmCP1886TWf8XdIvNY5vjvXGl6+VvqWVJcdxa+ddX5X307lr37PraqU+uTL38hUVT\r
+ 6KHNfkb/aTMD8mYWVaQU9dY2qCbmTA0IXq/EUpyRaKjFXFScCAABk71WIAMAAA==\r
+Cc: Notmuch Mail <notmuch@notmuchmail.org>\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: Thu, 12 Apr 2012 17:57:34 -0000\r
+\r
+Quoth Jani Nikula on Apr 12 at 8:02 am:\r
+> On Wed, 11 Apr 2012 17:11:13 -0400, Austin Clements <amdragon@MIT.EDU> wrote:\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
+> \r
+> Sure.\r
+> \r
+> One question: the template must be outside NOTMUCH_{BEGIN,END}_DECLS\r
+> (which are just macros for extern "C" block) but should it be within the\r
+> #pragma GCC visibility push(hidden) and pop directives? I'm not familiar\r
+> with that.\r
+\r
+Hmm. I'm not sure, but it can't hurt to have it inside the visibility\r
+directives. My guess would be that it will affect the visibility of\r
+the symbols produced when the template is instantiated, which we don't\r
+want to be visible outside the library. (As long as that doesn't mess\r
+up the linker's handling of weak symbols.)\r
+\r
+> Thanks for the review.\r
+> \r
+> \r
+> BR,\r
+> Jani.\r