DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(cpp.info) Macro Pitfalls

Info Catalog (cpp.info) Redefining (cpp.info) Macros
 
 Pitfalls and Subtleties of Macros
 ---------------------------------
 
    In this section we describe some special rules that apply to macros
 and macro expansion, and point out certain cases in which the rules have
 counterintuitive consequences that you must watch out for.
 

Menu

 
* Misnesting        Macros can contain unmatched parentheses.
* Macro Parentheses Why apparently superfluous parentheses
                          may be necessary to avoid incorrect grouping.
* Swallow Semicolon Macros that look like functions
                          but expand into compound statements.
* Side Effects      Unsafe macros that cause trouble when
                          arguments contain side effects.
* Self-Reference    Macros whose definitions use the macros' own names.
* Argument Prescan  Actual arguments are checked for macro calls
                          before they are substituted.
* Cascaded Macros   Macros whose definitions use other macros.
* Newlines in Args  Sometimes line numbers get confused.
 
Info Catalog (cpp.info) Redefining (cpp.info) Macros
automatically generated byinfo2html