Space after undeclared function name

Phillip L. Shaffer pls at ncsu.UUCP
Thu Nov 8 00:16:47 AEST 1984

I would like to obtain a consensus, or at least a few opinions, on
a minor point in C syntax.  I have recently obtained the Eco-C
C compiler for my Z-80 machine, and and am generally happy.  It
is doing one thing that I haven't seen before in other C compilers
(namely UNIX 4.2BSD or DeSmet on an IBM PC): it complains about
spaces after function names for funtions that have not been previously
declared - the error message is "illegal function call," or somesuch.
If you declare int functions before use, there is no problem.

	int foo();

	foo ();

causes no problem, but

	foo ();

generates the complaint.  K&R (p. 186, paragraph 4) seem to sanction
   "a hitherto unseen identifier followed immediately by a left
   parenthesis is contextually declared to represent a function
   returning an integer; thus, in the most common case, integer-
   valued functions need not be declared."

The question is: does "followed immediately" mean "with nothing
but white space in between" or is it to be taken literally?
This is a minor annoyance to me - changing styles slightly and
editing old programs before recompiling - but I thought I would
get some other opinions before complaining to Eco-Soft.

I will appreciate any responses - send mail to me and I will
summarize (or post your response if you like).  Thanks.

   Phil Shaffer (pls at ncsu)

More information about the Comp.lang.c mailing list