why function declaration and definition in same file?

Robert P. J. Day rpjday at mindspring.com
Thu May 11 11:00:24 UTC 2006


  i just noticed a recent change to networking/interface.c:

=======================================
--- interface.c (revision 15060)
+++ interface.c (working copy)
@@ -1729,6 +1729,7 @@
        return res;
 }

+int display_interfaces(char *ifname);
 int display_interfaces(char *ifname)
 {
        int status;
=======================================

  when did it suddenly become good programming practise to add
function declarations to a source file immediately before the
corresponding function definition?  and the same thing has been done
in route.c as well.  why?

rday



More information about the busybox mailing list