Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 68177 invoked by uid 500); 8 Jan 2002 02:29:55 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 68162 invoked from network); 8 Jan 2002 02:29:54 -0000 Message-ID: <3C3A59A6.9070902@xbc.nu> Date: Tue, 08 Jan 2002 03:29:58 +0100 From: Branko =?ISO-8859-2?Q?=C8ibej?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7) Gecko/20011221 X-Accept-Language: sl, en-gb, en MIME-Version: 1.0 To: Christian Gross CC: dev@apr.apache.org Subject: Re: Problem with pointer conversion References: <5.1.0.14.2.20020107151205.03640840@mail.devspace.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N A void pointer is implicitly converted to any other pointer type in C, so this cast shouldn't be necessary. Can you be a bit more specific about the compiler you're using, the platform, and the error message you get? Christian Gross wrote: > I was playing around with the HOOK code and noticed a little bug. > > Consider the macro APR_IMPLEMENT_EXTERNAL_HOOK_BASE and find the line > > pHook = apr_array_push( _hooks.link_##name); > > This line causes a compiler fault. pHook is typedefed, but > apr_array_push is a void pointer. Hence there is compiler problem. I > changed the line to the following > > pHook = (ns##_LINK_##name@@_t *)apr_array_push( _hooks.link_##name); > > Then things worked with no problem. Basically what was missing was a > typecast. > > Could this be added to the APR sources? > > Thanks > > Christian Gross > -- Brane �ibej http://www.xbc.nu/brane/