[gnu.gcc.bug] problem with function prototypes

karl@typo.umb.edu ("Karl Berry.") (10/22/88)

This is gcc 1.30, on a Sun 3 running 3.4, and a Vax 750 running 4.3bsd.

This function matches its prototype. gcc claims it doesn't.
(The GhostScript code uses this kind of prototyping.)

void debug_print_string(unsigned char);

/* Print a string */
void
debug_print_string(x)
unsigned char x;
{
 x = 10;
}

This produces the following:
gcc version 1.30
 /usr/local/gnu/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__HAVE_68881__ -Dmc68020 /tmp/x.c /tmp/cca03378.cpp
GNU CPP version 1.30
 /usr/local/gnu/lib/gcc-cc1 /tmp/cca03378.cpp -quiet -dumpbase /tmp/x.c -version -o /tmp/cca03378.s
GNU C version 1.30 (68k, MIT syntax) compiled by GNU C version 1.30.
/tmp/x.c: In function debug_print_string:
/tmp/x.c:7: argument `x' doesn't match function prototype


The problem does not occur if the function is declared by
...(unsigned char x);

instead of in the old-style C declarations.
 

Karl.    karl@umb.edu ...!harvard!umb!karl