Date: Tue, 16 Jun 1998 13:22:09 +0300 (IDT) From: Eli Zaretskii To: Vik Heyndrickx cc: Charles Marslett , DJ Delorie , nate AT cartsys DOT com, djgpp-workers AT delorie DOT com Subject: Re: inb/outb In-Reply-To: <35862AD6.7C5D@rug.ac.be> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 16 Jun 1998, Vik Heyndrickx wrote: > Suppose you have in ***another file*** a call to this function but no > prototype was given yet: > > double r = foo (7, 3); > > Since this 7 is an integral constant and no floating point constant it > will occupy only #sizeof(unsigned) number of bytes on the stack while > ``foo'' expects 8 bytes (a double). As a result it won't work. It *will* work if you say "foo (7.0, 3)". If I understand Charles' point, an existing prototype is an *incurable* problem (unless yo avoid including the header which declares the function) while a non-existing prototype is a problem you *can* cure. > 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.