Argument declaration style (WAS: ANSI C prototypes)

Dave Jones djones at megatest.UUCP
Thu Nov 8 14:55:19 AEST 1990


>From article <3944.27367fb2 at cc.helsinki.fi>, by jaakola at cc.helsinki.fi:
...

) The most significant advantage of the "old" style is that I can
) use the command
) 
) 	grep \)$ *.c
) 
) in UNIX or in MS-DOS with the PICNIX utilities to get output like
) 
) myfile.c:int foo(a,b)
) mydb.c:BOOL open_db(dbname,audit_file,username,password)
) mydb.c:BOOL get_record(key,buffer,bufferlen)



It is a standard convention to do it like so:

int
foo(a,b)

This way you can find the defining occurance of foo with

% egrep "^foo(" *.c

Sure, I know about "tags", but it is still handy to be able to
grep for the definition in column one.



More information about the Comp.lang.c mailing list