Path: utzoo!attcan!uunet!portal!cup.portal.com!Don_A_Corbitt From: Don_A_Corbitt@cup.portal.com Newsgroups: comp.lang.c Subject: Re: function prototype problem Message-ID: <11313@cup.portal.com> Date: 14 Nov 88 15:48:53 GMT References: <310@drd.UUCP> Distribution: na Organization: The Portal System (TM) Lines: 25 >char *rpeet ( short, char ); >char *rpeet ( num, ch) > short num; char ch; >-- >and get the following gripe from my compiler (gcc 1.30): > >rpeet.c: In function rpeet: >rpeekkjt.c:9: argument `num' doesn't match function prototype >rpeet.c:9: argument `ch' doesn't match function prototype > >Mark > tulsun!drd!mark@Sun.COM > DRD Corporation mlawrence@jarsun1.ZONE1.COM > (918)743-3013 drd!mark@apctrc.UU.NET > okstate!romed!drd!mark@rutgers.EDU The problem is you are mixing declaration types. Old style (K&R) automatically promotes short/char to int. New style (ANSI) lets you declare/pass shorts and chars (although it is usually less efficient). You should declare rpeet as char *rpeet(short num, char ch) { ... Don Corbitt, CrystalGraphics, Inc. Don_A_Corbitt@cup.portal.com "The place with no .signature file" (This is my first posting, if it ends up in New Zealand and nowhere else, I'd appreciate mailed hints on what I shoulda done...:-)