Argument declaration style (Was: ANSI C prototypes)

Karl Heuer karl at ima.isc.com
Sat Nov 10 16:13:13 AEST 1990


In article <1990Nov7.181615.11154 at craycos.com> pmk at craycos.com (Peter Klausler) writes:
>I also like ANSI prototypes, but use this style:
>	void
>	foo (int x, int y) {
>	}
>so that the function name always appears in column 1.

Personally, I think the existence of functions like "signal" demonstrates that
this isn't the way God intended functions to be written. :-)

The only advantage I've heard for this is that it makes it easy to find the
function with grep.  I'm willing to endure the hardship of using egrep instead
of grep in exchange for the benefit of having it print out the entire
declaration including type when it does find it.  Besides, my egrep pattern
works on macros too.

Karl W. Z. Heuer (karl at ima.isc.com or uunet!ima!karl), The Walking Lint
Followups to alt.religion.computers.



More information about the Comp.lang.c mailing list