Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

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

close form
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

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

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you do not see the email in your inbox, please check if it is filtered to one of the following folders:

  • Promotion
  • Updates
  • Spam

Webinar: Evaluation - 05.12

>
>
>
Examples of errors detected by the V631…

Examples of errors detected by the V631 diagnostic

V631. Defining absolute path to file or directory is considered a poor coding style. Consider inspecting the 'Foo' function call.


ffdshow

V631 Consider inspecting the 'fopen' function call. Defining an absolute path to the file or directory is considered a poor style. writersink.cpp 13


STDMETHODIMP TmyWriterSink::OnHeader(INSSBuffer *pHeader)
{
  if (!f) f=fopen("c:\\2.wmv","wb");
  BYTE *buf; DWORD len;
  pHeader->GetBufferAndLength(&buf,&len);
  fwrite(buf,1,len,f);
  return S_OK;
}

Even if this was written just for the purpose of debugging, you'd better not do it that way. Other programmers may have troubles working with it.


NetXMS

V631 Consider inspecting the 'CreateFileW' function call. Defining an absolute path to the file or directory is considered a poor style. netxmsd.cpp 126


static void CreateMiniDump(DWORD pid)
{
  ....
  hFile = CreateFile(
    _T("C:\\netxmsd.mdmp"), GENERIC_WRITE, 0, NULL,
    CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

  ....
}

VirtualDub

V631 Consider inspecting the 'LoadLibraryA' function call. Defining an absolute path to the file or directory is considered a poor style. VirtualDub leaks.cpp 67


VDDbgHelpDynamicLoaderW32::VDDbgHelpDynamicLoaderW32()
{
  hmodDbgHelp = LoadLibrary(
    "c:\\program files\\debugging tools for windows\\dbghelp");
  if (!hmodDbgHelp) {
    hmodDbgHelp = LoadLibrary("c:\\program files (x86)\\......
  ....
}

Similar errors can be found in some other places:

  • V631 Consider inspecting the 'LoadLibraryA' function call. Defining an absolute path to the file or directory is considered a poor style. VirtualDub leaks.cpp 69