Pour obtenir une clé
d'essai remplissez le formulaire ci-dessous
Demandez des tariffs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
RUB
* En cliquant sur ce bouton, vous acceptez notre politique de confidentialité

Free PVS-Studio license for Microsoft MVP specialists
To get the licence for your open-source project, please fill out this form
** En cliquant sur ce bouton, vous acceptez notre politique de confidentialité.

I am interested to try it on the platforms:
** En cliquant sur ce bouton, vous acceptez notre politique de confidentialité.

Votre message a été envoyé.

Nous vous répondrons à


Si vous n'avez toujours pas reçu de réponse, vérifiez votre dossier
Spam/Junk et cliquez sur le bouton "Not Spam".
De cette façon, vous ne manquerez la réponse de notre équipe.

>
>
PVS-Studio prints the error "Some …

PVS-Studio prints the error "Some diagnostic messages may contain incorrect line number for file ..." (continuation)

10 Nov 2009

We have already written about the causes of the warning "Some diagnostic messages may contain incorrect line number for file ...". Let me remind you that multi-line #define directives are processed incorrectly due to the preprocessor error in Visual C++ 2005 (without SP1). This leads to the PVS-Studio positioning error. If you get this warning I recommend that you read this note to understand the reason for that and how to deal with it.

Unfortunately, there is one more case when the warning "Some diagnostic messages may contain incorrect line number for file ..." is generated and a fault in positioning diagnostic warnings occurs. We speak about multi-line #pragma directives of a special kind. Here is an example of correct code:

#pragma warning(push) 
void test()
{
  int a = 0;
  size_t b = a; // PVS-Studio informs about the error here
}

But if you write #pragma directive in two lines PVS-Studio analyzer informs about the error in the wrong place (one-line fault):

#pragma \
  warning(push) 
void test()
{
  int a = 0;     // PVS-Studio informs about the error here,
  size_t b = a;  // but actually it is here.
}

Although in another case with a multi-line #pragma directive there is no error:

#pragma warning \
  (push) 
void test()
{
  int a = 0;
  size_t b = a; // PVS-Studio informs about the error in this line
}

Like in the previous note about the warning "Some diagnostic messages may contain incorrect line number for file ...", this error is related to using the Visual C++ preprocessor.

However, this error is not fixed by installing Service Pack 1 on Visual Studio 2005 or moving to Visual Studio 2008. The only recommendation is to either refuse to use multi-line #pragma directives or still use them but in the way they are correctly processed.

Comments (0)

Next comments
Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter