new style declarations OK for old style definitions?

Thomas M. Breuel tmb at ai.mit.edu
Wed Apr 3 21:17:24 AEST 1991


K&R/2 is a little vague on the following question: under what
circumstances is it legal to declare using new-style syntax a
separately compiled function that was compiled with an old-style
definition. 

Is it sufficient to use only promoted arguments in the new-style
declaration?

Conceivably, the whole calling sequence for old style and new style
definitions could differ. Is it legal for the compiler to choose
completely incompatible calling sequences for old-style and new-style
declarations? It would certainly be desirable, since new-style
declarations seem to allow for significant optimizations that aren't
possible with old-style declarations.

This is a frequent problem if you have old library binaries and
sources but want the extra type checking from an ANSI compiler.

				Thanks, Thomas.



More information about the Comp.lang.c mailing list