Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
Cannot process the whole file "foo…

Cannot process the whole file "foo.cpp"

14 Sep 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

S'abonner

Comments (0)

close comment form
close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam