After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 719504 - openfiles.cpp:165: possible bad expression ?
openfiles.cpp:165: possible bad expression ?
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: System-monitor maintainers
System-monitor maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-28 17:39 UTC by dcb
Modified: 2013-11-28 22:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description dcb 2013-11-28 17:39:22 UTC
I just ran the static analyser cppcheck 
over the source code of gnome-system-monitor-3.11.2

It said

[openfiles.cpp:165] -> [openfiles.cpp:165]: (style) Same expression on both sides of '=='.

Source code is

    return (o1->fd == o2->fd) && (o1->type == o1->type); /* XXX! */

Suggest new code

    return (o1->fd == o2->fd) && (o1->type == o2->type); /* XXX! */
Comment 1 Robert Roth 2013-11-28 21:13:46 UTC
Thanks for spotting that, I agree that that must be a typo, and will apply the patch. Anything else from cppcheck? Could you describe how did you run cppcheck (I have never used it) for me to learn something new? :) 

BTW, I've already committed the fix. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 2 dcb 2013-11-28 22:14:15 UTC
>Anything else from cppcheck?

Most unusually for the packages in Fedora 20, no.

>Could you describe how did you run cppcheck

I've modified the C and C++ compilers to also run
cppcheck over all the source code that the compilers see.

cppcheck --enable=all --std=posix whatever.c

is the command I use. You may wish to consider using
cppcheck as part of your development process. It
is available from sourceforge.