You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Tim Vernum <Ti...@macquarie.com.au> on 2001/07/10 06:00:13 UTC

[OT] K&R format (Was: build.exe)

From: Michael Jennings [mailto:southgate.software@home.com]

> > one of our developers in the czech republic uses something he call
> "kernigan
> > and ritchie"-style (don't even know if I have got the names 
> right) while
> > programming in Java :-(
> 
> K&R is kinduva dinosaur way of doing C function declarations as in:
> somefunction(x,y,z)
> (
> int x;
> char y;
> char *z;
> )
> {
> }
> 
> Or something like that anyways.

Kinda.

K&R versions of C had declarations/definitions like:

int somefunction( x,y,z )
	int x ;
	char y ;
	char * z ;
{
	/* some code */
}

Which was then "fixed" by ANSI.

But K&R formating is to do with the way they layout their code in "The C programming language",
which is (from 2nd Edition [ANSI])

    int Foo(int arg) {
        if (arg) {
            bar();
            return 1;
        } else
            return 0;
    }