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 709410 - A missing break in hanoi.c
A missing break in hanoi.c
Status: RESOLVED FIXED
Product: gcompris
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Bruno Coudoin
Rami Aubourg-Kaires
Depends on:
Blocks:
 
 
Reported: 2013-10-04 05:30 UTC by serval2412
Modified: 2013-10-04 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description serval2412 2013-10-04 05:30:07 UTC
Hello,

Cppcheck (a C++ static analyzer) reported this on gcompris sources "git updated" today:
[src/hanoi-activity/hanoi.c:248] -> [src/hanoi-activity/hanoi.c:251]: (warning) Variable 'number_of_item_x' is reassigned a value before the old one has been used. 'break;' missing?
[src/hanoi-activity/hanoi.c:249] -> [src/hanoi-activity/hanoi.c:252]: (warning) Variable 'number_of_item_y' is reassigned a value before the old one has been used. 'break;' missing?

Indeed we have:
    247     case 3:
    248       number_of_item_x = 5;
    249       number_of_item_y = 6;
    250     case 4:
    251       number_of_item_x = 6;
    252       number_of_item_y = 7;
    253       break;

So there's just a missing break to add after line 249.

Julien
Comment 1 Bruno Coudoin 2013-10-04 16:44:51 UTC
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.