Advertisement
PVS-StudioWarnings

PVS-Studio warning V559 for Scilab

Nov 10th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. int set_view_property(....)
  2. {
  3.   BOOL status = FALSE;
  4.   ....
  5.   status = setGraphicObjectProperty(
  6.     pobjUID, __GO_VIEW__, &viewType, jni_int, 1);
  7.  
  8.   if (status = TRUE)
  9.   {
  10.     return SET_PROPERTY_SUCCEED;
  11.   }
  12.   else
  13.   {
  14.     Scierror(999, _("'%s' property does not exist ")
  15.       _("for this handle.\n"), "view");
  16.     return  SET_PROPERTY_ERROR ;
  17.   }
  18.   ....
  19. }
  20.  
  21. This suspicious code was found in Scilab project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V559 Suspicious assignment inside the condition expression of 'if' operator: status = 1. set_view_property.c 61
  24.  
  25. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement