P
Philip Potter
santosh said:>phao said:Hi, i was reading this post and i'd like to know if is wrong doing
this:
/* begin of code */
datatype func_name(arglist) { ... } [snip]
suposing datatype is a valid datatype and arglist is a list of
arguments with valid datatypes and names, and func_name is a valid
name and { ... } for each function is a valid block of code.
Your compiler should emit a diagnostic for calling a function with no
prototype in scope. If it does not, please read your compiler's
documentation and supply the appropriate switches to make it do so.
Almost all compilers can diagnose this code feature.
I don't see why or where this diagnostic should arise. From his
definition of 'arglist' then he is using prototypes rather than K&R
declarations, and nothing from his post suggests he's calling func_name
before declaring it. I believe he was asking the difference between
defining all functions before use, with main() the last defined
function, and declaring all functions before use but defining them in
any order (say, with main() defined first).