Path: utzoo!telly!attcan!uunet!samsung!usc!wuarchive!psuvax1!rutgers!mcnc!rti!talos!kjones From: kjones@talos.pm.com (Kyle Jones) Newsgroups: gnu.gcc Subject: Re: Prototyping promotion problem. Message-ID: <1990Feb27.164108.15680@talos.pm.com> Date: 27 Feb 90 16:41:08 GMT References: <14331@s.ms.uky.edu> Reply-To: kyle@xanth.cs.odu.edu Lines: 32 Sean Casey writes: > (prototypes.h) > int addusage(char *name, char type, char *args, char *usage); > > (function def, this file includes prototypes.h) > addusage(name, type, args, usage) > char *name; > char type; > char *args; > char *usage; > { > etc. > } > > (error message) > gcc -g -pg -DSTRINGS_H -DTIME_H -c usage.c &151 > usage.c: In function addusage: > usage.c:38: argument `type' doesn't match function prototype > usage.c:38: a formal parameter type that promotes to `int' > usage.c:38: can match only `int' in the prototype You're using an old-style function definition, which ANSI C compilers interpret to mean "use the old rule of promoting chars arguments to ints" when calling such functions. You need to use the new definition style, which looks much like the prototype: int addusage(char *name, char type, char *args, char *usage) { ... }