Imagix 4D User Guide


Analyzer Syntax and Options

The Imagix 4D C/C++ analyzer is a stand-alone executable, independent from the Imagix 4D database and user interface. It is located in the ../imagix/bin directory, and uses the following syntax:

imagix-csrc [option...] file...

where option can be one or more imagix-csrc options (described below) and file is the full path name for one or more source files. Typically these are just the .c and .cpp source files of interest. While the file list of analysis targets can also directly specify header files, these are normally analyzed as the result of a #include "filename" preprocessor directive in the source code being analyzed.

The Imagix 4D analyzer supports the following options.

-1prog   Treat all the source code as if it is from the same executable.

The data flow analysis underlying most of the Flow Check reports requires that all of the source code be from a single program. The -1prog option causes the analyzer to treat all source code as if it is from the same executable; all matching global names are considered to refer to the same objects.

Option is selected as one of analysis options on the Options tab of the Data Sources dialog.

-asm   Support the use of keyword "asm".

Certain compilers support the placement of inline assembler code in C and C++ source files. This is done through a range of constructs (see the next User Guide section `Language Extensions'). The keyword "asm" is typically used to indicate the beginning of such a construct. While some of these inline assembler constructs are automatically handled by the analyzer, the -asm option enables the analyzer to avoid problems processing code containing certain other constructs.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-at   Support the use of keywords "@" and "_at_".

Certain compilers support the use of non-standard keywords "@" and "_at_" to specify the physical placement of variables in memory. This language extension cannot be supported through the usual "#define keyword" directives in the Imagix 4D compiler configuration files. The -at option enables the analyzer to avoid problems processing code that uses the "@" and "_at_" keywords.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-c11   Support the use of C++ 2011 general language enhancements.

Recent versions of certain compilers support various subsets of the language enhancements in the C++ 2011 standard. When combined with -c11k, this option enables support for the full set of enhancements.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-c11k   Support the use of C++ 2011 alternative operator spellings.

Recent versions of certain compilers support the alternative spelling of operators from the C++ 2011 standard, such as "and" for "&&", "bitor" for "|", and "not_eq" for "!=". Code written for compilers that don't support these alternative spellings may sometimes use these spellings as identifiers; to provide flexibility for such cases, support for alternative spellings is separated from general C++ 2011 language enhancements. When combined with -c11, this option enables support for the full set of enhancements.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-cdyn   Support the use of the Dynamic C language.

Dynamic C is a formal modification to the C language, supported by the Digi International / Rabbit / Z-World cross compiler for Rabbit hardware. The -cdyn option causes the analyzer to recognize and support the Dynamic C syntax and semantics.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-cfrontpt   Support the use of Cfront parameterized template directives.

The Cfront compiler supported the special directives PT_names, PT_define, and PT_end as a sort of early C++ template. The -cfrontpt option causes the analyzer to recognize and support these directives.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-cmmdFilename   Append the commands from Filename.

The imagix-csrc source analyzer is a command line executable. The -cmmd option adds an indirect way of specifying command line options. Any options specified in Filename are appended to the options specified on the command line itself. If Filename consists of multiple lines, imagix-csrc behaves as if it were invoked multiple times, each time with the options, if any, from the next individual line in Filename.

-cpascii   Analyze multi-byte source files as ASCII code page.
-cpeuc   Analyze multi-byte source files as EUC code page.
-cpsjis   Analyze multi-byte source files as SJIS code page.
-cputf8   Analyze multi-byte source files as UTF-8 code page.

The default behavior of the imagix-csrc source analyzer is to support a generic multi-byte code page. This works with most multi-byte source files. For unusual files not supported by the generic support, these -cpxxx options cause imagix-csrc to support a specific code page standard. Use just one -cpxxx option.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-cwdDirname   Set the current directory for analysis to Dirname.

The imagix-csrc source analyzer accepts relative paths for source files as well as the -I, -S, -H and -R options. These paths are relative to the current directory, which by default is where the source analyzer was invoked from. The -cwd option changes the starting directory for the relative paths.

Option should only be used with makefile or some other command line invocation of source analyzer.

-cpp   Analyze .c files as C++ files.

Normally, files with a .c suffix are analyzed using C language rules. Files with any C++ suffixes (.C, .cc, .cpp, etc.) are analyzed using C++ language rules. The -cpp option causes the C++ language rules to be used for .c files.

Option is selected as one of analysis options on the Options tab of the Data Sources dialog.

-Dmacroname[=value]   Define the macro macroname.

This is the same as the -D compiler option. Macro replacement is part of the analyzer's preprocessing of the source code. While a macro is defined, all occurrences of the identifier macroname will be replace by the token value. If no value is specified, the default value of 1 is used.

Option is specified in PP Flags field of Source Files tab of Data Sources dialog, or specified in makefile. The Windows version of the analyzer also accepts /D.

Macros can also be defined in the compiler configuration file, by adding an equivalent #define preprocessor directive. Macros having parameters are only supported through the compiler configuration file approach. For such macros, you'll need to add "#define FOO(x)" to a configuration file rather than use "-DFOO(x)" as a command line option.

-dotnetfuncs   Generate declarations for functions encountered via #import and #using.

Under Microsoft Visual C++, special directives access symbol definitions in binary files. The #import directive accesses COM type definitions residing in type library files. The #using directive accesses symbol definitions in compiled files under the Common Language Runtime (CLR) component of the .NET framework. The Windows version of imagix-csrc analyzes the referenced binary type library and .NET CLR files, and generates .inc files to represent the symbol declarations that they contain. By default, declarations for functions are omitted from these generated .inc files. The -dotnetfuncs option causes function declarations to be included along with the other symbol declarations in the .inc file.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-encmac   Collect cross reference data about macros.

The imagix-csrc source analyzer fully expands macros, and collects information about symbol usage hidden behind macros. For example, function calls made through macro expansions are visible in the Function Call Tree view. In addition, the use of a macro in a function is visible in the Function Calls with Macros view. However, the default behavior of the analyzer is to not record macro cross reference information. The -encmac option causes this information to be generated. The additional information shows up in File Editor highlighting as well as in the Function Calls with Macros view.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-genflowDirname   Write control and data flow data to files in directory Dirname.

The analyzer can collect data to generate displays and reports about the control and data flow in the source code analyzed. This flow data is kept in a set of files separate from where the entity / relationship / attribute data is stored. The location of these flow data files is controlled by the -genflow option. In order for Imagix 4D to find this data, the location specified needs to be in a directory named cfd, with the same directory path as the -genvdb data (i.e., parallel to the -genvdb data). If the -genflow option isn't used, no flow data is generated, and flow charts, calculation trees, control flow graphs, and certain reports can not be created.

Option is set automatically when adding data source.

-genqcfDirname   Write quality control data to files in directory Dirname.

The analyzer can run source code checks and collect metrics about symbols in the source files analyzed. This quality control data is kept in a set of files separate from where the entity / relationship / attribute data is stored. The location of these quality control data files is controlled by the -genqcf option. In order for Imagix 4D to find this data, the location specified needs to be in a directory named qcm, with the same directory path as the -genvdb data (i.e., parallel to the -genvdb data). If the -genqcf option isn't used, no quality control data is generated, and certain metrics and reports can not be created.

Option is set automatically when adding data source.

-genvdbDirname   Write analysis results to data files in directory Dirname.

The analyzer generates entity / relationship / attribute data for each of the source files explicitly analyzed, and each of the header files directly or indirectly included by those source files. The possible exception is header files in system include directories (see the -S and -nosys options).

When the -genvdb option is used, the data for each source or header file is stored in a separate file within the directory Dirname. This makes incremental analysis possible, and is the recommended approach. The alternative is to use the -o option.

Option is set automatically when adding data source.

-gnu   Enable GNU language extensions.

The GNU gcc and g++ compilers accept several keyword extensions to the standard C and C++ languages. The majority of these extensions are supported through the "#define keyword" directives in the compiler configuration files for the gnu compilers. However, certain extensions require additional support which is not possible through the use of #defines; this support is provided through the -gnu option.

Specifically, -gnu adds support for use of the "__asm" keyword to demarcate inline assembler code, for use of the "inline" keyword with C code, and for use of "std::" for all global identifiers in C++ code.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-Hdirname   Search dirname for #include files before searching the current directory.

When the analyzer encounters a #include "filename" preprocessor directive, it first searches for filename in all directories specified through the -H and the -R options. If filename is not found, the analyzer then searches for filename in the current directory ("."). If filename is still not found, the analyzer proceeds to search in the directories specified by -I and -S options. If #include <filename> is used instead of #include "filename", the current directory (".") is skipped.

The directories specified via -H are searched in the order that they are specified as options. These directories are treated as application include directories, the same as directories specified with the -I option. In order to treat these directories as system include directories, use the -R option. Refer to the -nosys option for the impact of this.

Option is specified in -I, -S Flags field of Include Dirs tab of Data Sources dialog, or specified in a compiler configuration file or a makefile. The Windows version of the analyzer also accepts /H.

-incFilename   Include Filename at start of analyzing each file.

Using the -inc option is equivalent to adding the line #include <Filename> at the beginning of each source file you are analyzing. It therefore enables you to change how files are analyzed without modifying the files themselves.

The major use of this option is for including the compiler configuration files. These configuration files define macros and the location of include directories, enabling the Imagix 4D analyzer to emulate the compiler you normally use to compile your code.

Filename is selected from files in ../imagix/user/cc_cfg by selection in Comp/Trgt combobox on Source Files tab of Data Sources dialog.

-Idirname   Add dirname to the list of directories to search for #include files.

When the analyzer encounters a #include "filename" preprocessor directive, it first searches for filename in all directories specified through the -H and the -R options. If filename is not found, the analyzer then searches for filename in the current directory ("."). If filename is still not found, the analyzer proceeds to search in the directories specified by -I and -S options. If #include <filename> is used instead of #include "filename", the current directory (".") is skipped.

The Imagix 4D analyzer distinguishes between #include <filename> and #include "filename" only to determine whether to search the current directory. To declare an include directory as a system include directory, use -Sdirname rather than -Idirname. Refer to the -nosys option for the impact of this.

Option is specified in -I, -S Flags field of Include Dirs tab of Data Sources dialog, or specified in a compiler configuration file or a makefile. The Windows version of the analyzer also accepts /I.

-keeplinks   Evaluate Unix links as actual directories and files.

Normally, links in Unix systems are resolved to the actual directories or files to which they point. When this option is applied, links are instead evaluated as separate directories and files.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile. The option only applies in the Unix version of the analyzer.

-kr   Support the Kernigan and Ritchie dialect of the C language.

For the most part, the Imagix 4D analyzer is able to analyze C code without the user needing to specify whether the code conforms to the ANSI C or the older K&R C dialect. However, there are certain constructs involving comments in the middle of macros where the behavior differences between the two dialects can not be automatically resolved. The analyzer defaults to supporting ANSI C. Applying the option causes the K&R specification to be supported. This option can also be invoked as -traditional, for consistency with the GNU compilers.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-lc   Convert file references to lower case.

While Unix is case sensitive with regard to file names, Windows is not. This can cause problems when analyzing Windows code in a Unix environment. For example, Windows code may contain the preprocessor directives #include <STDIO.H> in some files and #include <stdio.h> in others. These directives are equivalent in the Windows environment, and the same file stdio.h would be included with either directive.

However, in a Unix environment, the directives are not equivalent. Either STDIO.H or stdio.h would not be found, and therefore the Windows code would not preprocess correctly. The -lc option causes the analyzer to convert all file references to lower case. When -lc in used, the directive #include <STDIO.H> would cause the analyzer to search the include directories for stdio.h, thereby causing #include <STDIO.H> and #include <stdio.h> to again be equivalent.

When using the -lc option under Unix, be sure to convert all actual directory and file names to lower case.

Because Imagix 4D runs under both Windows and Unix, there are some case sensitivity issues in a Windows environment as well. Because the Imagix 4D database is able to distinguish between upper case and lower case file names, a single file might appear in the database under two different files. For example, if a file is included through both a #include <stdio.h> directive and a #include <STDIO.H>, it would show up twice in the database. Using the -lc option under Windows effectively eliminates this case sensitivity.

When using the -lc option under Windows, there is no need to change any file names.

Option is selected as one of analysis options on the Options tab of the Data Sources dialog under Unix. Option is set automatically when adding data source under Windows.

-lci   Convert file references for #include directives only to lower case.

When using the -lc option, all directory and file names passed to the analyzer are converted to lower case. In addition to the names in the #include directives, the -lc option converts the names of any directories specified through -H, -I, -R or -S flags and the names of the source files passed to the analyzer for analysis. Thus, in a Unix environment, the complete directory structure down to the source code and header files must consist of lower case directory and file names.

The -lci option only converts the names in the #include directives. This is useful when you have moved Windows code into a Unix environment and you find it impractical to change the case of existing, higher-up Unix directories.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-locals   Collect data about local variables.

Normally, the Imagix 4D analyzer collects data just about global and static variables, as local variables are set or read only by the function where they're defined, and thus provide little aid in understanding your software. Occasionally you may be interested in collecting data about local variables, for example when you're interested in certain quality metrics such as Class Coupling. Using the -locals option causes data about local variable definitions and usage to be added to the data files.

Option is selected as one of analysis options on the Options tab of the Data Sources dialog.

-mark   Precede all analyzer messages with "imagix: "

Analyzer error messages normally start with the name of the file where they occur. Using the -mark option causes all error messages to be preceded with the string "imagix: ". This is useful where the analyzer error messages are intermixed with other messages to stderr, such as when running the analyzer in a makefile.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-msc   Enable Microsoft language extensions.

The Microsoft Visual C and Visual C++ compilers accept several keyword extensions to the standard C and C++ languages. The majority of these extensions can be supported through the "#define keyword" directives in the compiler configuration file for the compilers. However, certain extensions require additional support which is not possible through the use of #defines; this support is provided through the -msc option.

In Microsoft Visual C++, the keywords _asm and __asm indicate the beginning of a block of in-line assembler code. The keywords _segment, __segment, _base and __base deal with segmented memory and offsets. Through the -msc option, the Imagix 4D analyzer is able to avoid problems analyzing source code where these language extensions are used.

The -msc option also supports the preprocessor directive #import, used with the type library concept in COM programming under Microsoft Visual C++. Under the -msc option, when analyzer finds:

#import <filename.ext>
#import "filename.ext"
it performs an include on filename.tlh. It searches the include directories, as specified with -I and -S options, to find the tlh file.

In addition, the -msc keyword causes several keywords to be in effect ignored, as they are simple modifiers having no impact on the symbol and relationship information being collected by the analyzer. This is true for cdecl, far, fortran, huge, near, pascal, _cdecl, _export, _far, _fastcall, _fortran, _huge, _interrupt, _loadds, _near, _pascal, _saveregs, __cdecl, __export, __fastcall, __far, __fortran, __huge, __interrupt, __loadds, __near, __pascal and __saveregs. For these keywords, the same analysis results could be achieved by adding the line "#define keyword" in the compiler configuration file.

Since several other compilers support at least a subset of these Microsoft extensions, you may find the -msc option useful for non-Microsoft code.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-msgFilename   Write analyzer messages to Filename rather than stdout.

As the analyzer processes source code, it outputs a series of messages regarding the file being processed, and any analysis issues that it encounters. Normally, the analyzer sends these messages to stdout. With the -msg option, the messages are instead written directly to a file.

-msrc   Store the results of multiple analysis passes of source code.

As the analyzer processes source code, a single header file might be processed several times, due to being included by multiple different files. Each time the header file is analyzed, the current status of macro definitions is used. The use of #ifdef, #ifndef and #if's may cause each pass through the header to yield different results. For example, a typedef may be defined a certain way in one pass, and not be defined at all in another pass.

As the source analyzer processes code, it retains a knowledge of the header file from the most recent pass, so that downstream analysis uses the correct type definitions, etc. But for presenting information in the displays and reports, a single representation of a file's contents is necessary.

The normal, default behavior is for Imagix 4D to store and later use the data file based on the analyzer's first pass through the header file. This reflects the code that was initially conditionally active.

There may be cases where you wish to examine all the code that was ever active through any pass through the header file. Using the -msrc switch will cause the results from all passes through the header file to be stored in the data file, and thus be used in creating Imagix 4D displays and reports.

Option is selected as one of analysis options on the Options tab of the Data Sources dialog. Note that -msrc only works within the same invocation of the source analyzer. It does not track multiple visits to the same header file over different source analyzer invocations, as could occur with the makefile approach or if different projects are combined into a comboproject.

-msrcf   Store the results of multiple analysis passes of source code (expanded).

When processing multiple passes through a header file, the option -msrc causes the analyzer to keep track of which lines have been analyzed already. On each pass, information is collected about any lines that have not yet been analyzed. In most cases, this is sufficient for capturing the meaning of conditionally compiled code.

There may be cases where the meaning, and the resulting cross-reference data, for a given line changes from one analysis pass to the next. For these cases, -msrcf provides a stronger alternative to -msrc. Essentially, the option -msrcf causes information to be collected about every line of the header files for every time it is included. This option should be used with caution because it can significantly inflate database size and slow performance. It is only valuable when header files are purposefully included multiple times to generate new code based on different define settings.

An alternative invocation of -msrcf is as -msrcffilename.c. When invoked this way, the stronger data collection is applied just during the analysis of filename.c. Other source files are analyzed as if -msrc had been used.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile. When the -msrcf option is used, the -msrc option should be disabled.

Note that -msrcf only works within the same invocation of the source analyzer. It does not track multiple visits to the same header file over different source analyzer invocations, as could occur with the makefile approach or if different projects are combined into a comboproject.

-nestcom   Support nested C style comments.

Most compilers do not support the use of nested C style comments. In the following code,

/* A /* B */ C */ D = 1;
these compilers would consider C to be a symbol, and would indicate a problem with the */ following C. However, some compilers will treat C */ as the closing part of the comment that starts at /* A, and will ignore everything up until D. Using the -nestcom option causes the Imagix 4D analyzer to behave like this latter set of compilers.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-neu   Support the use of the Neuron C language.

Neuron C is a formal modification to the C language, supported by the Echelon cross compiler for Echelon hardware. The -neu option causes the analyzer to recognize and support the Neuron C syntax and semantics.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-noendasm   Support #asm as a single line precompiler directive.

Certain compilers support the placement of inline assembler code in C and C++ source files. This is done through a range of constructs (see the next User Guide section `Language Extensions'). Common compiler conventions are supported automatically by the analyzer, including the use of precompiler directives of #asm and #endasm to demarcate lines of inline assembler. However, not all compilers support #asm in this manner; some compilers instead allow users to place #asm at the beginning of a line to indicate that the rest of that line consists of inline assembler code. In this case, there is no closing #endasm directive. This latter use of #asm without a corresponding #endasm is supported through this option.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-nosys   Do not generate data for system header files.

Use of -Sdirname rather than -Idirname in specifying include directories designates a directory as a system directory rather than an application directory. Regardless of whether the -nosys option is used, header files from the system directory are analyzed when included, as this is required to accurately analyze your software. However, when the -nosys option is set, no data is collected about header files found in system directories.

The impact of using -nosys is that you can't browse and explore the files where system symbols, such as fprintf, are declared. Since there is generally little value in examining the contents of files such as stdio.h, normally you would enable -nosys, thereby filtering out data that has little value for you.

Option is selected as one of analysis options on the Options tab of the Data Sources dialog.

-nosysbodies   Do not generate data for bodies of functions defined in system header files.

Use of -Sdirname rather than -Idirname in specifying include directories designates a directory as a system directory rather than an application directory. Regardless of whether the -nosysbodies option is used, header files from the system directory are parsed when included, as this is required to accurately analyze your software. However, when the -nosysbodies option is set, no data is created about the contents of functions defined in system directories. Essentially, this is a less severe form of -nosys.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile. Option is automatically added if -nosys is enabled through the Options tab of the Data Sources dialog.

-oFilename   Write analysis results to datafile Filename.

The analyzer generates entity / relationship / attribute data for each of the source files explicitly analyzed, and each of the header files directly or indirectly included by those source files. The possible exception is header files in system include directories (see the -S and -nosys options).

When the -o option is used, the data for all of the source and header files is stored in the single file Filename. This option is available for reasons of historical compatibility. The -genvdb option is recommended.

Option is never set through the Imagix 4D user interface.

-Rdirname   Search dirname for #include files before searching the current directory.

When the analyzer encounters a #include "filename" preprocessor directive, it first searches for filename in all directories specified through the -R and the -H options. If filename is not found, the analyzer then searches for filename in the current directory ("."). If filename is still not found, the analyzer proceeds to search in the directories specified by -I and -S options. If #include <filename> is used instead of #include "filename", the current directory (".") is skipped.

The directories specified via -R are searched in the order that they are specified as options. These directories are treated as system include directories, the same as directories specified with the -S option. In order to treat these directories as application include directories, use the -H option. Refer to the -nosys option for the impact of this.

Option is specified in -I, -S Flags field of Include Dirs tab of Data Sources dialog, or specified in a compiler configuration file or a makefile. The Windows version of the analyzer also accepts /R.

-Sdirname   Add dirname to the list of directories to search for #include files.

When the analyzer encounters a #include "filename" preprocessor directive, it first searches for filename in all directories specified through the -H and the -R options. If filename is not found, the analyzer then searches for filename in the current directory ("."). If filename is still not found, the analyzer proceeds to search in the directories specified by -I and -S options. If #include <filename> is used instead of #include "filename", the current directory (".") is skipped.

The Imagix 4D analyzer distinguishes between #include <filename> and #include "filename" only to determine whether to search the current directory. To declare an include directory as an application include directory, use the option -Idirname rather than -Sdirname. Refer to the -nosys option for the impact of this.

Option is specified in -I, -S Flags field of Include Dirs tab of Data Sources dialog, or specified in makefile. The Windows version of the analyzer also accepts /S.

-sfx   Append a suffix to the files names associated with -genflow and -genqcf data.

Normally, data generated with the -genflow and -genqcf switches is stored in files whose names end with the same suffixes as the corresponding original source and header files. This can cause difficulties in certain configuration management systems. -sfx causes an additional _sfx to be appended to the file name, so that data generated from a .c source file is stored in a file having a .c_sfx suffix.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-sysincfirst   Search the -S directories before the -I directories for any header files specified with < >.

The default search behavior in locating an included file is to search the include directories in the order that the -I and -S options are specified. If application header files are included as #include "appfile.h", and system include files as #include <sysfile.h>, name conflicts can be reduced through the -sysincfirst option, because the file search is started in the appropriate set of include directories constructs (see the User Guide section `System vs. Application Include Directories').

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-traditional   Support the Kernigan and Ritchie dialect of the C language.

For the most part, the Imagix 4D analyzer is able to analyze C code without the user needing to specify whether the code conforms to the ANSI C or the older K&R C dialect. However, there are certain constructs involving comments in the middle of macros where the behavior differences between the two dialects can not be automatically resolved. The analyzer defaults to supporting ANSI C. Applying the option causes the K&R specification to be supported. This option can also be invoked -kr.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-trkmem   Track each instantiation of struct / union member as a separate variable.

The -trkmem option effects how members of aggregate variables (variables of aggregate types such as structs or unions) are analyzed by imagix-csrc and subsequently presented in the user interface. The default behavior is to track the aggregate variables themselves as separate variables, but to combine and track equivalent members between aggregate variables as a single variable. For example, assume that two variables var1 and var2 are of the same type structA, and that structA has a member memA. The default behavior of the tool is to track var1 and var2 separately, but to consider var1.memA and var2.memA together, simply as memA. For many uses of the tool, this results in the appropriate tradeoff of specificity and complexity in the resulting database. However, there may be times when you wish to track each instantiation of memA separately. The -trkmem option causes this to occur, so that var1.memA would be considered a different variable than var2.memA.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-Umacroname   Undefine the macro macroname.

This is the same as your -U compiler option. Macro replacement is part of the analyzer's preprocessing of the source code. While a macro is undefined, code in the block defined by the conditional compilation directive `#ifdef macroname' will not be analyzed.

Option is specified in PP Flags field of Source Files tab of Data Sources dialog, or specified in makefile. The Windows version of the analyzer also accepts /U.

-uaggr   Regard top-level classes defined in different files as being different classes.

The standard behavior of compilers is to apply a global naming rule whereby all top-level classes with the same name within the same compilation unit (executable, DLL or library) are considered to be the same class. There may be times when you want to define a project that spans multiple compilation units. In such cases, the separate compilation units may happen to reuse the same top-level class names for what are actually different classes. This name conflict can be avoided through the -uaggr option. When -uaggr is used, all top-level classes defined in different files are considered to be different classes, even if they have the same names.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-unique   Regard typedefs defined in different files as being different typedefs.

The default behavior of the imagix-csrc source analyzer is to assume that duplicate type definitions (typedefs with the same name defined in multiple files) are the result of a programming convenience, and are intended to be the same typedef. For example, a simple typedef might be added to a source file in order to avoid including a large header file. If you're applying a coding guideline where common types must be defined in header files, then using the -unique option will ensure that separately defined types having the same name are treated as different typedefs.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-vms   Enable VMS language extensions.

Most compilers accept several keyword extensions to the standard C and C++ languages. The majority of these extensions are supported through the "#define keyword" directives in the compiler configuration files. However, certain extensions require additional support which is not possible through the use of #defines; for some keywords, this support is provided through the -vms option.

Specifically, -vms adds support for use of the "_align (identifier)" and "__align (identifier)" declaration specifiers.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-voidfptr   Include instances of void* in function pointer analysis.

The default behavior of the imagix-csrc source analyzer is to ignore instances of void* in analyzing calls through function pointers, as they can result in a considerable number of false positives. However, if void* is used in your code as a way of handling function pointers, this option should be enabled.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-vuid   Generate VUIDs for each symbol being analyzed.

When you generate documentation about your project, you normally build the full document in a single pass. In this case, the symbol identifiers used for the hypertext links are assigned when the database is loaded. Because the document is built in a single session, the identifiers are consistent between the HTML pages.

The -vuid option causes visualizer unique identifiers to be generated at the time the source code is analyzed, rather than when the project is loaded. The resulting consistency of identifiers across project sessions enables partial and incremental generation of the HTML documentation. See the file ../imagix/user/doc_gen/sample.dg_ for more information about partial and incremental documentation generation.

Option can be added in PP Flags field of Source Files tab of Data Sources dialog, or specified in a compiler configuration file or a makefile.

-warn   Return all analyzer warnings.

When analyzing source code, the Imagix 4D analyzer may encounter syntax or semantic errors, caused by either the source code itself, or by the macro definitions and include paths used to analyze the code.

By default, the analyzer returns error messages for just significant problems, where include files can't be found, or where lines of code need to be skipped to resynchronize the analyzer. Using the -warn option causes the analyzer to return messages for all problems it encounters.

Sometimes it is useful to use the -warn option to isolate initial problems that cause more significant errors later in the analysis.

Option is always enabled through the user interface. Resulting warning messages are either displayed or filtered out of the Analysis Results window according to the display settings (Display > Show Xxxx).

Spaces in Directory Names

Several of the options listed above (-cmmd, -cwd, -genXXX, -H, -I, -inc,-msg, -R, and -S) consist of an option name followed directly by a directory name or a file name. Under Windows, directory and file names can have spaces in them. When such spaces exist, place double quotes (") around the full -optionDIRNAME string so that full directory name is processed as part of the option.

For example, -incC:/progra~1/imagix/user/cc_cfg/msvc_win.inc is ok.

But -incC:/program files/imagix/user/cc_cfg/msvc_win.inc would need to be specified as "-incC:/program files/imagix/user/cc_cfg/msvc_win.inc" because of the space.

Unsupported Options

When the Imagix 4D analyzer is passed an option that it doesn't support, it converts the option into a macro definition. For example, -ansi causes the macro __IMGX_ansi__ to be defined, and -Xc leads to __IMGX_Xc__ being defined. Each - in the option is converted to _, all other non-alphanumeric characters are transformed into $<ASCII-value>. For example, passing the option --lang_c++ to the analyzer causes the macro __IMGX__lang_c$43$43__ to be defined.

This conversion offers flexibility in using your current compilation-related options with the Imagix 4D compiler configuration files.

Note that any option starting with -H, -I, -R or -S is interpreted as indicating an include path, and is therefore not considered an unsupported option.