Date: Thu, 5 Oct 2000 17:49:28 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: "Paulo J. Matos aka PDestroy" cc: djgpp AT delorie DOT com Subject: Re: Strange error In-Reply-To: <8ri3am$l53$1@venus.telepac.pt> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 5 Oct 2000, Paulo J. Matos aka PDestroy wrote: > void wait_u(void) { > getkey(NULL); > } > > Waits for the user to press any key. I've implemented in a program I made > some months ago. Now I copy-pasted to my new program I'm doing now and the > compiler says:setup.c: In function `wait_u': > setup.c:124: too many arguments to function `getkey' > > How strange!!! On the other program it compiled correcly... Let me guess: the program which doesn't compile #include's the header pc.h, while the one which compiles doesn't include it. pc.h declares a prototype of the function getkey(), which tells the compiler that it doesn't accept any arguments. So the compiler complains when you call it with an argument of NULL. If you don't make the prototype visible to the compiler, it won't complain (but your program will then have a bug that waits to bite you). That's why you are well advised to always include the appropriate headers for the library functions you call.