Curious about function prototypes...

Doug Gwyn gwyn at brl-smoke.ARPA
Sat Jun 11 19:12:18 AEST 1988


In article <654 at orion.cf.uci.edu> nagel at ics.uci.edu (Mark Nagel) writes:
>A friend of mine who is installing the GNU C compiler here tells me that the
>ANSI standard has changed this so that the function body header must look
>like the function prototype.  The GNU documentation says that something like
>the above is now an error.

It's not an error, so long as the argument types are what you would get
from the default argument promotions (as they are in this case).

However, it is not a good idea to mix new-style (prototype) and old-style
function syntax.  The proposed ANSI C provides rules for resolving the
collision of these two ways of doing business, but that's intended for
grandfathering in existing code, not to be used for new code.  New code
should consistently use prototype style for both declarations and
definitions.



More information about the Comp.lang.c mailing list