R
rs
Dear All,
I have a question regarding proptypes for functions. What is the
recommended practice? The way I do it is to put all my external functions
in a header file, while protyping internal (file scope) functions at the
start of the source file. I've seen many people (especially using gcc
under linux) don't botehr prototyping internal functions but just declare
them inline so to speak.
Is there any recommendations advantages/disdvantages of the approach? It
seems to be that there is a tradeoff here:
1. If the prototypes are going to help me by catching incorrect parameter
types,numbers etc.. they are worth having
2. However its a hassle to maintain them.
So, the question is, are most modern compilers able to catch type/number
errors so that I can avoid prototyping internal functions? What are your
suggestions?
I have a question regarding proptypes for functions. What is the
recommended practice? The way I do it is to put all my external functions
in a header file, while protyping internal (file scope) functions at the
start of the source file. I've seen many people (especially using gcc
under linux) don't botehr prototyping internal functions but just declare
them inline so to speak.
Is there any recommendations advantages/disdvantages of the approach? It
seems to be that there is a tradeoff here:
1. If the prototypes are going to help me by catching incorrect parameter
types,numbers etc.. they are worth having
2. However its a hassle to maintain them.
So, the question is, are most modern compilers able to catch type/number
errors so that I can avoid prototyping internal functions? What are your
suggestions?