Re: Passing too many parameters to a function?
Re: Passing too many parameters to a function?
- Subject: Re: Passing too many parameters to a function?
- From: email@hidden (Peter Seebach)
- Date: Thu, 24 Aug 2006 14:47:21 -0500
In message <email@hidden>, Uli Kusterer writes:
> Does that mean it's actually safe to do this after all, under these
>limited circumstances? I originally thought so, as I actually once
>managed to call a function with too many parameters (it was a
>horrible mess of typecasts -- don't ask, I was young and needed the
>experience) and it didn't blow up in my face right away, which kinda
>surprised me. But I just thought I'd been lucky.
I have no idea. The problem is that there are so very many ways in which it
MIGHT fail, depending on exactly what you're passing, and I don't know the
ABI.
I would consider it almost certainly foolhardy, but it's up to you.
>And we want new & old plugins to work on the host app now, while the
>future host app will only accept new ones. It sounds like this will
>work after all? Don't worry about portability, because even if a port
>was planned, it'd require the new callback style *with* the context
>pointer right away.
In that case, my suggestion is this: Test it. You don't even care about
the general case of extra parameters; you care about the SPECIFIC case of
this particular extra parameter, and of course, you can check for that.
I would suggest, if you wanna be very careful: Embed some assembly around
the call to check all the registers before and after to see what happens,
just in case of madness.
-s
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden