Sender: Vik DOT Heyndrickx AT rug DOT ac DOT be Message-ID: <358652E8.20C2@rug.ac.be> Date: Tue, 16 Jun 1998 13:11:36 +0200 From: Vik Heyndrickx MIME-Version: 1.0 To: Eli Zaretskii CC: Charles Marslett , djgpp-workers AT delorie DOT com Subject: Re: inb/outb References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk 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