To get a trial key
fill out the form below
Team License (a basic version)
Enterprise License (an extended version)
* By clicking this button you agree to our Privacy Policy statement

Request our prices
New License
License Renewal
--Select currency--
USD
EUR
RUB
* By clicking this button you agree to our Privacy Policy statement

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

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

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

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.

>
>
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.

Comments (0)

Next comments
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site.
Learn More →
Accept