Mail Archives: djgpp-workers/1998/06/16/07:11:51
Eli Zaretskii wrote:
> > A function declared (and defined) in one file as:
> > void *foo_XQ (void *, int);
> >
> > In another file (originally written for another platform, on which the
> > function is declared ``void *foo_XQ (int,void *)'') it is assumed foo_XQ
> > will be defined in DJGPP, but DJGPP provides no prototypes for it:
> >
> > void *p;
> > void *r = foo_XQ (7, p);
>
> Same here: add a prototype inside your source, or use explicit cast in
> the call, and it *will* work.
If ``it will work'' means that it will compile without errors or
warnings then you are right, but as a result of specifying the wrong
prototype -as coded inline in the source-, the arguments will end up in
the wrong order of the calling stack and as a result garbage is passed
to foo_XQ (in my interpretetation that means ``it won't work''), since
foo_XQ is a library function.
IMHO
--
\ Vik /-_-_-_-_-_-_/
\___/ Heyndrickx /
\ /-_-_-_-_-_-_/ Knight in the Order of the Unsigned Types
- Raw text -