in-line functions

Guy Harris guy at rlgvax.UUCP
Sun Feb 10 04:04:50 AEST 1985


> jss at sjuvax (J. Shapiro) suggests that we consider inline functions,
> rather than ridiculously complex macros.  It's a good idea.  MESA has
> an INLINE keyword which does the obvious thing.  One could use
> ``register'' functions in C to do the same thing.

C++ has an "inline" keyword as well; I first saw the inline function idea
in the Mesa Reference Manual, and though it was a neat idea - I was glad
to see C++ picking it up.  (But wouldn't a "register" function be one that
was copied to the general registers and executed on a PDP-10? :-))

> One point (which is obvious when you think about it) is that the
> function definition must be available to all routines that use it; the
> straightforward approach of generating no code for a register function
> breaks the existing scope rules in C.  Two solutions come to mind:
> either put the definition in a header file (which might fail if
> compilers were allowed to ignore the register keyword when applied to
> functions)...

C++ takes this approach; since all C++ compilers support the "inline"
keyword, the problem you mention doesn't occur.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.lang.c mailing list