Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 54871 invoked from network); 7 Jun 2006 23:58:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jun 2006 23:58:53 -0000 Received: (qmail 62824 invoked by uid 500); 7 Jun 2006 23:58:53 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 62656 invoked by uid 500); 7 Jun 2006 23:58:52 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 62645 invoked by uid 99); 7 Jun 2006 23:58:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 16:58:52 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of bojan@rexursive.com designates 203.171.74.242 as permitted sender) Received: from [203.171.74.242] (HELO beauty.rexursive.com) (203.171.74.242) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2006 16:58:51 -0700 Received: by beauty.rexursive.com (Postfix, from userid 48) id 1D7D025565C; Thu, 8 Jun 2006 09:58:30 +1000 (EST) Received: from cache4.syd.ops.aspac.uu.net (cache4.syd.ops.aspac.uu.net [203.166.96.238]) by www.rexursive.com (Horde MIME library) with HTTP; Thu, 08 Jun 2006 09:58:29 +1000 Message-ID: <20060608095829.u79vt6zn404ssos0@www.rexursive.com> Date: Thu, 08 Jun 2006 09:58:29 +1000 From: Bojan Smojver To: dev@apr.apache.org Subject: Re: svn commit: r412252 - /apr/apr-util/trunk/dbd/apr_dbd_sqlite2.c References: <20060607020444.6C33C1A983A@eris.apache.org> <20060607085603.GB17796@redhat.com> In-Reply-To: <20060607085603.GB17796@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.1) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Quoting Joe Orton : > This is really still a long way from "properly" - both the old and new > code has undefined behaviour because of the function cast. The following code, from apr_dbd.c, probably won't have an easy fix =20 like the drivers did: -------------------------------------------------- #define CLEANUP_CAST (apr_status_t (*)(void*)) [..snip..] APU_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver, apr_pool_t *pool, =20 apr_dbd_t *handle, apr_dbd_transaction_t **trans) { int ret =3D driver->start_transaction(pool, handle, trans); if (*trans) { apr_pool_cleanup_register(pool, *trans, CLEANUP_CAST driver->end_transaction, apr_pool_cleanup_null); } return ret; } APU_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_transaction_t *trans) { apr_pool_cleanup_kill(pool, trans, CLEANUP_CAST driver->end_transaction= ); return driver->end_transaction(trans); } -------------------------------------------------- We are just lucky here that driver->end_transaction() takes a txn =20 pointer and returns an int, which is equivalent for most intents and =20 puposes to (apr_status_t (*)(void*)). --=20 Bojan