Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uwm.edu!psuvax1!news From: melling@cs.psu.edu (Michael D Mellinger) Newsgroups: comp.sys.next Subject: Re: short int in GNU cc Message-ID: <..6G-!y$@cs.psu.edu> Date: 12 Mar 91 16:52:10 GMT References: Sender: news@cs.psu.edu (Usenet) Distribution: comp Organization: Penn State Computer Science Lines: 37 In-Reply-To: jefft@chirality.rsa.com's message of 11 Mar 91 21:37:03 GMT Nntp-Posting-Host: sunws5.sys.cs.psu.edu In article jefft@chirality.rsa.com (Jeff Thompson) writes: Hi there, I want to use prototyping in my NeXT GNU C program for a function which takes a short int as an argument, such as: int MyFunc (short int); int MyFunc (x) short int x; { } I get the error: argument `x' doesn't match function prototype a formal parameter type that promotes to `int' can match only `int' in the prototype. How can I keep using prototypes without having to change all my functions to pass `int' instead of `short int' ? Declare your functions like this: int MyFunc (short int); int MyFunc (short int x) { } You were mixing the old style C declarations with the new style. -Mike BTW: Old style obsolete, don't use.