[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] error parsing function-pointer type to va_arg

From: Rob
Subject: Re: [Tinycc-devel] error parsing function-pointer type to va_arg
Date: Fri, 29 Jun 2012 23:34:38 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Jun 29, 2012 at 10:16:28PM +0200, Stephan Beal wrote:
> On Fri, Jun 29, 2012 at 10:12 PM, Rob <address@hidden> wrote:
> > However this seems fine by the man page:
> >
> > > The argument type is a type name specified so that the type of a
> > > pointer to an object that has the specified type can be obtained
> > > simply by adding a * to type.
> >
> > So it's a problem with sqlite4 if you want to be picky.
> >
> Thanks for that - i'm happy to accept a picky answer :). i have since found
> that i need to use a typecast for this type of case with gcc, anyway, so
> i'm refactoring now.

Why's that the case? Just curious, from what I could tell gcc accepts function
pointers there just fine.

> > If you want a quick fix, something like this will work:
> >
> > void *tmp = va_arg(ap, void *);
> > pMkr->xFactory = tmp;
> >
> Here's what i did:
> http://www.sqlite.org/src4/fdiff?v1=1007d3ae2514bed9&v2=2f3c6f816aef8456
> (the green and purple bits in the lower right)
> i think that's a different instance, but the same type of problem. Without
> the typedef (the left side), gcc complains that the types are the same (i
> have no idea why). The typedef is cleaner, and "should" work with tcc
> (haven't tried it yet), but i'll be back with more details if it doesn't
> for some reason ;).

Yeah - a typedef is much better than what I proposed.
tcc accepts it fine here.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]