Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
>
Preprocessed *.i file

Preprocessed *.i file

Mar 11 2013

A preprocessed *.i file is an output of the C or C++ preprocessor. It is usually this extension which is characteristic of files created as the preprocessor output. The preprocessor performs primary transformations of the source program text using only lexical analysis.

The preprocessor carries out the following operations:

  • Inclusion of header files (the '#include' instruction);
  • Macros substitution (the '#define' instruction);
  • Conditional compilation (instructions '#if', '#ifdef', '#else', '#elif', '#endif').

The preprocessor can be used as an auxiliary tool to assist static code analysis. The PVS-Studio static analyzer, for example, can use three different preprocessors (MSVC, Clang, C++Builder), and which of them is chosen to be used for a particular project depends on the type of the project or file. This procedure is necessary because the core of the analyzer is the code parsing library VivaCore that doesn't possess an integrated preprocessor. The necessity of primary preprocessing of source files is determined by the fact that all the instructions '#include' and '#define' should be expanded to enable good static analysis.

You can get a preprocessed file in the MSVC environment by defining the value of the 'Generate Preprocessed File' property on the 'C/C++\Preprocessor' tab as shown in Figure 1.

preprocessed_i_file/image1.png

To get a preprocessed file using the GCC compiler you need to add the parameters '-E -o file_name.i' into its call.

References

Popular related articles


Comments (0)

Next comments next comments
close comment form