[cairo] Re: cairo_get_current_point bug ?

Mike Emmel mike.emmel at gmail.com
Fri Sep 22 13:43:39 PDT 2006


On 9/22/06, Jamey Sharp <jamey at minilop.net> wrote:
> On Fri, Sep 22, 2006 at 12:49:51PM -0700, Carl Worth wrote:
> > On Thu, 14 Sep 2006 16:59:11 -0700, "Mike Emmel" wrote:
> > > -void
> > > +cairo_status_t
> > >  cairo_get_current_point (cairo_t *cr, double *x_ret, double *y_ret)
> >
> > Behdad just mentioned that it's too late to do this. From an API
> > point-of-view, there would obviously be no problem, but presumably
> > changing the stack like that would not allow us to provide the ABI
> > compatibility we've promised.
>
> That seems like an interesting question. Are there any platforms
> (capable of running Cairo) that return an int on the stack, or do they
> all return such values in registers? More importantly, is the calling
> convention ever different for functions that return void versus those
> that return int?
>
> K&R compilers couldn't have distinguished this case, I think, and I have
> the impression that calling conventions haven't changed much since K&R
> days. So it seems to me that this change actually would be ABI
> compatible everywhere. If this is the cleanest fix for this problem,
> perhaps more research should go into this question.
>
> --Jamey
>

As far as I know your free to change return values as much as you want
except for the case of returning small structs on the stack.
Thats the only place cpu's/compilers differ.
Some cases there returned on the stack and some cases as a pointer
in a register.

C++ is where this becomes a issue not in general C.

And easy real world place to see real return implementations it to dig
int libffi  it runs on a lot
of processors and sidesteps this stack return problem.

Over this the question would be dealing with non gcc/VisualC compilers
but I don't see this as being a huge issue.

I know you promised binary compatibility but your free to change return
values except for the small struct stack case  not break 99% of the
platforms in my opinion.



>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (GNU/Linux)
>
> iD8DBQFFFEZQp1aplQ4I9mURAow+AJwJRG17eMThGTwDwN8ta4rjKO+5EwCePoOZ
> nA3HGnLTHlMNpkLgYKfOX98=
> =2w5C
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
>
>


More information about the cairo mailing list