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

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.

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

Comments (0)

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