Compiler Configuration Files

The Imagix 4D analyzer is compiler independent. In order to analyze your software the same way that your compiler parses your software, the Imagix 4D needs to be set up to emulate your compiler. This is done through the compiler configuration files.

These configuration files, which are found in ../imagix/user/cc_cfg, set up the Imagix 4D analyzer to behave like the compiler you use to compile your code. The files, which contain c source code, provide three things required by the analyzer. First, they direct the analyzer where to look for system header files, such as stdio.h. This is specified in lines such as:

#pragma cmdflag -S/usr/include
Secondly, the compiler configuration files compensate for language extensions supported by the compiler. For example, many C compilers support the keyword near, which effects memory allocation by the compiler but has no meaning to the structure of your software. Another example is the keyword byte, which is not a standard C language type, but is predefined by some compilers. The compiler configuration file enables you to create macro definitions and typedefs to compensate for these extensions, such as:

#define near
#define byte char
typedef char byte;
The third area of compiler emulation involves macro definitions used by the compiler when it preprocesses its system header files. Often, the compiler's header files might be set up to build software for a number of target systems. Such header files contain conditional compilation directives such as #ifdef _I386 so that compiler uses sections of the header files source code appropriate for the target being built. The compiler configuration file supports this by making any such implicit compiler macro definitions explicit in the compiler configuration file:

#define __I386
These keyword extensions and implicit macro definitions are often described in your compiler's documentation. Look for information on keywords, language extensions, predefined macros, or macro definitions.

Imagix 4D comes with a number of configuration files already set up for leading compilers. If you're using one of these compilers, you'll want to modify the configuration file slightly to reflect where system header files are located in your build environment. If you're not using a one of these compilers, it is strongly recommended, but not required, that you create such a configuration file to emulate the compiler you use.

See Configure a Compiler Configuration File for further instructions. Also, there is a special utility for gcc-based compilers and special instructions for Microsoft Visual C++.