Func Protos with K&R Func Defs

Steve Summit scs at adam.mit.edu
Fri Mar 1 06:28:49 AEST 1991


In article <1991Feb28.072947.28885 at athena.mit.edu>, I wrote:
>[carefully mixing prototype declarations with old-style function
>definitions] works well, although there are two important
>caveats which require some care in applying, which is why mixing
>prototyped declaration with "old style" definitions is not
>generally recommended.

I left out a third, important caveat: "old style" definitions (as
well as external function declarations without prototypes) are
officially "obsolescent," and may be removed from future revisions
of the standard.  (See X3.159 sections 3.9.4 and 3.9.5 .)
Therefore, my last paragraph should read:

> If you want to keep using old tools (compilers,
> lint, etc.), and if you're not using an automated ANSI->K&R tool,
> and if you don't like #ifdefs or other preprocessor tricks in
> function definitions,

and if you won't mind having to rewrite your code in ten years or
so,

> use these mixtures in good health.

(This is not supposed to sound sarcastic; you should think about
what will happen to your code ten years down the line.  A
surprising amount of code, coddled by compilers which continued
to accept them, still used =+ and the like ten years after =op
was deprecated.)

                                            Steve Summit
                                            scs at adam.mit.edu



More information about the Comp.lang.c mailing list