Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
Cannot process the whole file "foo…

Cannot process the whole file "foo.cpp"

Sep 14 2009
Author:

Sometimes PVS-Studio analyzer cannot analyze a file with a source code completely. There are various reasons. Perhaps, the analyzer did not manage to analyze an especially complex template or something of the kind. Rarely, but it happens. As a rule this is not crucial from the viewpoint of analysis as only a small fragment of code remains unanalyzed. That's why the warning "Cannot process the whole file" is generated by PVS-Studio analyzer only if "Pedantic mode" is enabled in the settings.

In this note I would like to specify that it is not always the fault of PVS-Studio analyzer that the warning "Cannot process the whole file" appears. In some cases the program text can actually contain an error which is nevertheless ignored by Visual C++ compiler. It happens when the error is situated in the body of a function of template class which is never used in the program and consequently never instanced.

As an example you can open the file "Microsoft Visual Studio 8\VC\atlmfc\include\atldb.h" and study the template class CErrorReporterHelper. PostError function contains an error. In one of the lines a semicolon is missing:

template <const GUID* pguidProvider>
class CErrorReporterHelper
public:
  HRESULT PostError(HRESULT hrErr, IID* piid)
  {
    . . .
    errorinfo.hrError  = hrErr;
    errorinfo.iid    = *piid;
    spCrtErrInfo->SetGUID(errorinfo.iid)   //  <- ERROR
    spCrtErrInfo->SetSource(OLESTR("Provider PROGID"));
    . . .

But this error will not prevent you from using the header file atldb.h in your projects. If you do not need CErrorReporterHelper class there will be no compilation error.

But as for PVS-Studio, as it uses different algorithms of code parsing, it will "stumble" inside the function over the same error and show the warning "Cannot process the whole file". The analyzer will also not be able to check the part of this function. But in this case it does not matter absolutely because the code of the incorrect function is not used anywhere.

Popular related articles


Comments (0)

Next comments next comments
close comment form
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 do not see the email in your inbox, please check if it is filtered to one of the following folders:

  • Promotion
  • Updates
  • Spam