Re: [PATCH] lib: work around talloc_steal usage from C++ code
authorAustin Clements <amdragon@MIT.EDU>
Thu, 12 Apr 2012 21:04:14 +0000 (17:04 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:19 +0000 (09:46 -0800)
49/213549df744dbc2ba3562d50fc07c1a48ecdc7 [new file with mode: 0644]

diff --git a/49/213549df744dbc2ba3562d50fc07c1a48ecdc7 b/49/213549df744dbc2ba3562d50fc07c1a48ecdc7
new file mode 100644 (file)
index 0000000..b4946c5
--- /dev/null
@@ -0,0 +1,92 @@
+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 983F5431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Apr 2012 14:04:18 -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 I0E2kUoGO3VT for <notmuch@notmuchmail.org>;\r
+       Thu, 12 Apr 2012 14:04:18 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
+       [18.7.68.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id EFB0D431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Apr 2012 14:04:17 -0700 (PDT)\r
+X-AuditID: 12074422-b7fd66d0000008f9-6a-4f874351da85\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+       by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 86.B7.02297.153478F4; Thu, 12 Apr 2012 17:04:17 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q3CL4G16031950; \r
+       Thu, 12 Apr 2012 17:04: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 q3CL4ERX029107\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 12 Apr 2012 17:04:15 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1SIRBe-0004qI-OO; Thu, 12 Apr 2012 17:04:14 -0400\r
+Date: Thu, 12 Apr 2012 17:04:14 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Jani Nikula <jani@nikula.org>\r
+Subject: Re: [PATCH] lib: work around talloc_steal usage from C++ code\r
+Message-ID: <20120412210414.GI13549@mit.edu>\r
+References: <1334264259-17632-1-git-send-email-jani@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1334264259-17632-1-git-send-email-jani@nikula.org>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFupkleLIzCtJLcpLzFFi42IRYrdT0Q10bvc3+NAqZdE03dni+s2ZzBYd\r
+       t3ezOTB73Lr/mt3j2apbzB4fn95iCWCO4rJJSc3JLEst0rdL4MqY0TOLsWAaa0XXrkPsDYwT\r
+       WboYOTkkBEwkDiz+zQxhi0lcuLeerYuRi0NIYB+jxKbuN+wgCSGBDYwSC5+bQ9gnmSQmz1SF\r
+       sJcwSmycwQhiswioShz98Q2snk1AQ2Lb/uVgcREBRYnNJ/cD2RwczALuEieXGYGEhQXcJPqP\r
+       HwC7gVdAR+L8vTnMECPtJSb+XskEEReUODnzCVgNs4CWxI1/L5kgxkhLLP/HARLmFHCQOH4c\r
+       YpOogIrElJPb2CYwCs1C0j0LSfcshO4FjMyrGGVTcqt0cxMzc4pTk3WLkxPz8lKLdE31cjNL\r
+       9FJTSjcxgkPcRWkH48+DSocYBTgYlXh4Xz5r8xdiTSwrrsw9xCjJwaQkymvg1O4vxJeUn1KZ\r
+       kVicEV9UmpNafIhRgoNZSYT3z2Ogct6UxMqq1KJ8mJQ0B4uSOK+61js/IYH0xJLU7NTUgtQi\r
+       mKwMB4eSBO9qkKGCRanpqRVpmTklCGkmDk6Q4TxAw0+C1PAWFyTmFmemQ+RPMSpKifOeBkkI\r
+       gCQySvPgemEp6BWjONArwryzQKp4gOkLrvsV0GAmoMF8CiBXF5ckIqSkGhgZCq9G+24+3355\r
+       945US00hG9FLDmuyZJhK8rOTV8wRTBVMYMvZGMcbG5zNn/y+ch//530ffcRNRSaJ6O0xbdyS\r
+       /SRD7RlDrTP3/QzG/rzEpYkpe5zkNy6c/ETx8YXHob862HawNBUlPPNmSAj9Wc+XdPGmWekd\r
+       4X6vAFGeU3+3XLrE33RaTYmlOCPRUIu5qDgRABUpF3scAwAA\r
+Cc: 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 21:04:18 -0000\r
+\r
+Quoth Jani Nikula on Apr 12 at 11:57 pm:\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 in\r
+> some GCC versions. Otherwise, a cast is required. Provide a template\r
+> function for this to maintain type safety, and redefine talloc_steal\r
+> to use it.\r
+> \r
+> The template must be outside the extern "C" block (NOTMUCH_BEGIN_DECLS\r
+> and NOTMUCH_END_DECLS), but keep it within the GCC visibility #pragma.\r
+> \r
+> No functional changes, apart from making the library build with\r
+> compilers other than recent GCC.\r
+> \r
+> Signed-off-by: Jani Nikula <jani@nikula.org>\r
+\r
+LGTM.\r