In early versions of C, the prototype only needed to specify the name of the function - not the parameter list or return type. For example:
#include <stdio.h>
min();
main() {
printf("%d\n", min(5, 3, 6));
printf("%d\n", min(1, 4, 2));
printf("%d\n", min(0, 2, 7));
}
min(int a, int b, int c)
{
return (a < b) ?
((a < c) ? a : c) : ((b < c) ? b : c);
} |
(i) Discuss the implications with respect to compile-time error checking.
(ii) Discuss the implications with respect to backwards compatibility for modern C compilers.