register vs. stack calling convention problem in WATCOM

Xiaodan Tang <xtang@qnx.com> wrote:

Rick Lake <> rwlake@spam.redirected.to.dev.null> > wrote:
OK, well I ventured to track down all situations in the code where this
problem occurs, but I soon learned that this is not so trivial. The
problem is intertwined in lots of nesting and calls. However, as far as
[…]
I also tested this on the example I posted by changing:

typedef void (*functype)(char *, …);
to
typedef void (*functype)();

Shouldn’t it more easier to change the define of your “func()” ?

void func(char *str, int n)
to
void func(char *str, int n, …)

Yes, there is nothing after “int n”, but this at least tell
compiler that “func()” is also a stack calling function?

That would work also. But the biggest problem is finding all of those
functions in the samba code that need to be changed (corresponding to my
“func” example) Once I have an overview of them, any of the suggested
clean solutions is OK.

-xtang

regards,
rick

“Rick Lake” <rwlake@SPAM.REDIRECTED.TO.DEVNULL.COM> wrote in message
news:9cof2l$1jo$1@inn.qnx.com

That would work also. But the biggest problem is finding all of those
functions in the samba code that need to be changed (corresponding to my
“func” example) Once I have an overview of them, any of the suggested
clean solutions is OK.

Do a grep on “…” or “…)” or “,…” or “, …” and see what turns up.
Make a list of function casts and for recursively grep both function
pointers and functions until you have them all.
That is what I would do. It is hard work but you will wind up with a
complete list.

Stephen Howe [TeamSybase]

Yeah, that’s more or less the path I’m in.

thanks,
rick
[to be continued next week]

Stephen Howe <SPAMsjhoweGUARD@dial.pipex.com> wrote:

“Rick Lake” <> rwlake@SPAM.REDIRECTED.TO.DEVNULL.COM> > wrote in message
news:9cof2l$1jo$> 1@inn.qnx.com> …

That would work also. But the biggest problem is finding all of those
functions in the samba code that need to be changed (corresponding to my
“func” example) Once I have an overview of them, any of the suggested
clean solutions is OK.

Do a grep on “…” or “…)” or “,…” or “, …” and see what turns up.
Make a list of function casts and for recursively grep both function
pointers and functions until you have them all.
That is what I would do. It is hard work but you will wind up with a
complete list.

Stephen Howe [TeamSybase]