Macro Analysis

Macro Analysis

 
Report:  Macro Analysis
Option:  -m
Compatible Options: RSM Option Cross Reference
Usage: rsm -H -O"report.htm" -m -n maccomp.c 
Source:  C and C++
Similar to the -fa option, -m identifies and analyzes C macros.  If macros do not exist in the source, then no macros will be emitted.  The use of macros in C++ code is not advised because macros are not type safe; they use a different language syntax; they are interpreted by the preprocessor for which there is no ANSI standard and in many debuggers macros have no symbolic context.  We advise using inline functions in C++ in lieu of macros.

Macros are a common cause of maintenance and portability headaches, so locating their existence is quite 
valuable. 

In Windows code there is an occurrence of placing a macro between the function name and the function open parenthesis or between the class name and the opening brace. You must tell RSM about the macros by either processing the macro prior to its use or you may add the macro by name to a special file called rsm_macro.cfg. Names in this file are read at startup so that RSM knows about your macros defined in other portions of the code which may not be processed by RSM. The rsm_macro.cfg file is located with your rsm.lic license file.