Re: [PATCH 4/4] Explicitly type void* pointers
authorVladimir Marek <Vladimir.Marek@Oracle.COM>
Mon, 9 Apr 2012 18:15:43 +0000 (20:15 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:11 +0000 (09:46 -0800)
da/3e817a57fc8976a364d66e774e70469d35280a [new file with mode: 0644]

diff --git a/da/3e817a57fc8976a364d66e774e70469d35280a b/da/3e817a57fc8976a364d66e774e70469d35280a
new file mode 100644 (file)
index 0000000..baca7f3
--- /dev/null
@@ -0,0 +1,114 @@
+Return-Path: <Vladimir.Marek@Oracle.COM>\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 E8B8B414B8D\r
+       for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 11:16:16 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -4.999\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-4.999 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_HI=-5, UNPARSEABLE_RELAY=0.001]\r
+       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 xvF+Ljw03T1D for <notmuch@notmuchmail.org>;\r
+       Mon,  9 Apr 2012 11:16:16 -0700 (PDT)\r
+Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 5A4EF41735F\r
+       for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 11:16:16 -0700 (PDT)\r
+Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])\r
+       by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with\r
+       ESMTP id q39IGEMf026954\r
+       (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)\r
+       for <notmuch@notmuchmail.org>; Mon, 9 Apr 2012 18:16:15 GMT\r
+Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])\r
+       by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id\r
+       q39IGEFm000337\r
+       (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)\r
+       for <notmuch@notmuchmail.org>; Mon, 9 Apr 2012 18:16:14 GMT\r
+Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55])\r
+       by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id\r
+       q39IGDdc006260\r
+       for <notmuch@notmuchmail.org>; Mon, 9 Apr 2012 13:16:13 -0500\r
+Received: from pub.czech.sun.com (/10.163.20.32)\r
+       by default (Oracle Beehive Gateway v4.0)\r
+       with ESMTP ; Mon, 09 Apr 2012 11:16:13 -0700\r
+Date: Mon, 9 Apr 2012 20:15:43 +0200\r
+From: Vladimir Marek <Vladimir.Marek@Oracle.COM>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH 4/4] Explicitly type void* pointers\r
+Message-ID: <20120409181543.GC10554@pub.czech.sun.com>\r
+Mail-Followup-To: Notmuch Mail <notmuch@notmuchmail.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
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+In-Reply-To:\r
+ <CAB+hUn_QyMAfC1-Dr23T63ObX=cwuBOzcyCi=61w0MtGRMyt2w@mail.gmail.com>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Source-IP: acsinet22.oracle.com [141.146.126.238]\r
+X-CT-RefId: str=0001.0A090207.4F83276F.00EC,ss=1,re=0.000,fgs=0\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: Mon, 09 Apr 2012 18:16:17 -0000\r
+\r
+Hi,\r
+\r
+> Hi, does notmuch not compile without this? IIRC talloc_steal is a macro\r
+> that's supposed to provide type safety (at least with GCC), and I'd be\r
+> hesitant about adding the casts. Please look in your talloc.h.\r
+\r
+It does not compile. It might be that I'm using Sun/Oracle CC instead of\r
+gcc. The error looks like this:\r
+\r
+"lib/database.cc", line 1368: Error: Cannot assign void* to const char*.\r
+\r
+\r
+When looking into talloc documentation, the definition seems to be:\r
+\r
+void* talloc_steal ( const void * new_ctx, const void * ptr )\r
+\r
+http://talloc.samba.org/talloc/doc/html/group__talloc.html#gaccc66139273e727183fb5bdda11ef82c\r
+\r
+\r
+When looking into talloc.h, it says:\r
+\r
+/* try to make talloc_set_destructor() and talloc_steal() type safe,\r
+   if we have a recent gcc */\r
+\r
+So, maybe the way to satisfy everyone would be:\r
+\r
+notmuch_message_t *tmp_message = message;\r
+talloc_steal(notmuch, tmp_message);\r
+return(tmp_message);\r
+\r
+Or alternatively,\r
+\r
+#if (__GNUC__ >= 3)\r
+       return talloc_steal (notmuch, message);\r
+#else\r
+       return (notmuch_message_t*) talloc_steal (notmuch, message);\r
+#fi\r
+\r
+\r
+Of course I'm happy either way :)\r
+\r
+Thank you\r
+-- \r
+       Vlad\r