COHERENT manpages

This page displays the COHERENT manpage for macro [Definition].

List of available manpages
Index


macro -- Definition

A macro is a body of text that is given a name.  When the name is used in a
program, it  is replaced with the  text to which it  refers; this is called
macro expansion.  For example,  getchar() is a  macro that consists  of the
function call  getc(stdin). The C preprocessor  recognizes two varieties of
macros: object-like and function-like.

When the  C compiler performs macro substitution,  all escape sequences and
trigraphs  have  been  resolved.  After  a  macro  has  been expanded,  the
expanded text is scanned again to  see if the expansion itself contains any
macros (not  including the original macro that  has already been expanded).
This re-scanning continues until no further replacement is possible.

Most macros are defined in C headers.  The C preprocessor, however, defines
some others.

See Also

#define,
C preprocessor,
m4,
manifest constant,
Programming COHERENT
ANSI Standard, §3.8.3