Examples of errors detected by the V763 diagnostic.


V763. Parameter is always rewritten in function body before being used.


Inkscape

V763 Parameter 'new_value' is always rewritten in function body before being used. sp-xmlview-tree.cpp 259


void element_attr_changed(.... const gchar * new_value, ....)
{
  NodeData *data = static_cast<NodeData *>(ptr);
  gchar *label;

  if (data->tree->blocked) return;

  if (0 != strcmp (key, "id") &&
      0 != strcmp (key, "inkscape:label"))
        return;

  new_value = repr->attribute("id"); // <=
  ....
}

Similar errors can be found in some other places:

  • 763 Parameter 'widget' is always rewritten in function body before being used. ruler.cpp 923

ReOpenLDAP

V763 Parameter 'rc' is always rewritten in function body before being used. tls_o.c 426


static char *
tlso_session_errmsg(...., int rc, ....)
{
  char err[256] = "";
  const char *certerr=NULL;
  tlso_session *s = (tlso_session *)sess;
  rc = ERR_peek_error(); // <=
  ....
}


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++, and C#

goto PVS-Studio;
On our website we use a cookie to collect information of a technical nature.
If you do not agree, please leave the site. Learn More →
Do not show again