Prototyping char parameters in ANSI C

Jacob Gore gore at eecs.nwu.edu
Tue Apr 25 13:03:26 AEST 1989


Is this valid ANSI C (or dpANS or whatever you want to call it):

	void f(char);

	void f(c)
	   char c;
	{
	}

The version of GNU cc I have complains:

	t.c: In function f:
	t.c:5: argument `c' doesn't match function prototype
	t.c:5: a formal parameter type that promotes to `int'
	t.c:5: can match only `int' in the prototype

Is this rule for real, or is this just a gcc bug?

Jacob Gore				Gore at EECS.NWU.Edu
Northwestern Univ., EECS Dept.		{oddjob,chinet,att}!nucsrl!gore



More information about the Comp.lang.c mailing list