Liste des Groupes | Revenir à cl c |
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:Without doubt, most functions (and non-local data) should be static.Bart <bc@freeuk.com> writes:Hmm, in well-written code static functions are likely to be aIt's another point of confusion. In my language I don't treat function>
declarations like variable declarations. A function is not a
variable. There is no data storage associated with it.
In C, declarations can declare objects, functions, types, etc. I fail
to see how your language is relevant.
>In C it is unfortunate, as it makes it hard to trivially distinguish a>
function declaration (or the start of a function definition) from a
variable declaration.
It's not as hard as you insist on pretending it is. A function
declaration includes a pair of parentheses, either empty or
containing a list of parameters or parameter types.
>
Function declarations outside header files are valid, but tend to be
rare in well-written C code.
majority. Some people prefer to declare all functions and
put declarations of static functions in the same file as the
functions itself. Conseqently, function declarations are not
rare in such code. Do you consider it well-written?
Les messages affichés proviennent d'usenet.