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