Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
Issue with '(' and ')'characters in PAT…

Issue with '(' and ')'characters in PATH system environmental variable while using PVS-Studio with Visual Studio 2008

08 Déc 2010
Author:

At times the users of PVS-Studio static analyzer encounter the following issue while starting the analysis using Visual Studio 2008 IDE.

The analysis does not start and only one message of the following kind is produced

\Utilities\Bin\x86";"C:\WINDOWS\system32";"C:\WINDOWS";
"C:\WINDOWS\System32\Wbem";"C:\Program. was unexpected at this time.

After thoroughly investigating this issue we've determined that such a behavior is caused by an error in one of Visual Studio's environment configuration bat files. And this file is:

..\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat

The PVS-Studio analyzer uses vsvars32.bat file to configure the environment before launching Visual C++ preprocessor. It turns out that this particular issue is caused by the following fragment of the file:

@if not "%WindowsSdkDir%" == "" (
 set "PATH=%WindowsSdkDir%bin;%PATH%"
 set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%"
 set "LIB=%WindowsSdkDir%lib;%LIB%"
)

The issue will manifest itself if the PATH environmental variable will have been containing the '(' and ')' characters, as if for example Microsoft DirectX SDK will have been included into it - "C:\Program Files\Microsoft DirectX SDK (August 2006)\Utilities\Bin\x86". Than the statement following the 'if' operator

@if not "%WindowsSdkDir%" == "" (
 set "PATH=%WindowsSdkDir%bin;%PATH%"

will be terminated by one of the closing parentheses in PATH, as in this case ..August 2006), which results in the issue at hand.

This leaves us with two solutions of the problem:

  • Remove any path that has '(' and ')' characters from your PATH system environment variable.
  • Rewrite the 'If' statement using goto operator like this:
@if "%WindowsSdkDir%" == "" goto SkipSDKVariableSet

@set "PATH=%WindowsSdkDir%bin;%PATH%"
@set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%"
@set "LIB=%WindowsSdkDir%lib;%LIB%"

:SkipSDKVariableSet

The second path here creates another problem with installation of updates as they could rewrite this code fragment in vsvars32.bat file.

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