Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define __GO_FIGURE__ 9
- #define __GO_UIMENU__ 21
- int sci_uimenu(char *fname, unsigned long fname_len)
- {
- ....
- if (iParentType == __GO_FIGURE__ &&
- iParentType == __GO_UIMENU__)
- {
- Scierror(999, _("%s: Wrong type for input argument #%d: ")
- _("A '%s' or '%s' handle expected.\n"),
- fname, 1, "Figure", "Uimenu");
- return FALSE;
- }
- ....
- }
- This is what should have been written here: iParentType != __GO_FIGURE__ && iParentType != __GO_UIMENU__
- This suspicious code was found in Scilab project by PVS-Studio static code analyzer.
- Warning message is:
- V547 Expression 'iParentType == 9 && iParentType == 21' is always false. Probably the '||' operator should be used here. sci_uimenu.c 99
- 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