Page MenuHomeWildfire Games

Fix "clobbered" warning in Jenkins build
ClosedPublic

Authored by Itms on Jan 4 2017, 11:31 AM.

Details

Reviewers
leper
wraitii
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP19111: Fix warning with GCC in our lowlevel PNG texture code.
Summary

As you must have noticed by now, Jenkins comes up with a few warnings when it builds. Some of them are going to be fixed in D24, but there is a "clobbered" warning in tex_png.

This stack overflow thread: http://stackoverflow.com/questions/7721854/what-sense-do-these-clobbered-variable-warnings-make explains the reason of the error.
It is fixed by rewriting encode in the same way as decode.

Test Plan

Check on your compiler that there is no warning, and validate that Jenkins doesn't show up this warning either.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

wraitii updated this revision to Diff 123.Jan 4 2017, 11:31 AM
wraitii retitled this revision from to Fix "clobbered" warning in Jenkins build.
wraitii updated this object.
wraitii edited the test plan for this revision. (Show Details)
wraitii added a reviewer: Restricted Owners Package.
wraitii set the repository for this revision to rP 0 A.D. Public Repository.
Vulcan added a subscriber: Vulcan.Jan 4 2017, 1:11 PM

Build is green

Updating workspaces.
Build (release)...
../../../source/gui/CChart.cpp:38:41: warning: unused parameter ‘Message’ [-Wunused-parameter]
 void CChart::HandleMessage(SGUIMessage& Message)
                                         ^
Build (debug)...
../../../source/gui/CChart.cpp:38:41: warning: unused parameter ‘Message’ [-Wunused-parameter]
 void CChart::HandleMessage(SGUIMessage& Message)
                                         ^
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/86/ for more details.

elexis added a subscriber: elexis.Jan 4 2017, 1:18 PM

Code comments shouldn't include uncertainties oor relativization.

Itms commandeered this revision.Jan 4 2017, 5:19 PM
Itms added a reviewer: wraitii.
Itms added a subscriber: Itms.

It would be better to fix the issue the error message is hinting at. It might be a false positive but the function is not nicely written: an evil goto, big inconsistencies with the decode function.

I propose a patch that makes encode quite similar to decode, fixes the issue and removes the goto.

Itms updated this revision to Diff 129.Jan 4 2017, 5:22 PM
Itms updated this object.
wraitii accepted this revision.Jan 4 2017, 6:08 PM
wraitii edited edge metadata.

Sure, why not. I just decided to be lazy :P .

This revision is now accepted and ready to land.Jan 4 2017, 6:08 PM
Vulcan added a comment.Jan 4 2017, 6:41 PM

Build is green

Updating workspaces.
Build (release)...
../../../source/gui/CChart.cpp:38:41: warning: unused parameter ‘Message’ [-Wunused-parameter]
 void CChart::HandleMessage(SGUIMessage& Message)
                                         ^
Build (debug)...
../../../source/gui/CChart.cpp:38:41: warning: unused parameter ‘Message’ [-Wunused-parameter]
 void CChart::HandleMessage(SGUIMessage& Message)
                                         ^
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/90/ for more details.

Vulcan added a comment.Jan 4 2017, 7:24 PM

Build is green

Updating workspaces.
Build (release)...
../../../source/gui/CChart.cpp:38:41: warning: unused parameter ‘Message’ [-Wunused-parameter]
 void CChart::HandleMessage(SGUIMessage& Message)
                                         ^
Build (debug)...
../../../source/gui/CChart.cpp:38:41: warning: unused parameter ‘Message’ [-Wunused-parameter]
 void CChart::HandleMessage(SGUIMessage& Message)
                                         ^
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/91/ for more details.

leper accepted this revision.Jan 4 2017, 7:40 PM
leper added a reviewer: leper.
leper added a subscriber: leper.

Just to clean up some confusion: The evil thing here is setjmp/longjmp which has more of those "evil" properties referenced in that (in?)famous goto paper than actual goto in C and C++.

But nice that this warning finally gets fixed! (Properly that is.)

This revision was automatically updated to reflect the committed changes.
elexis changed the visibility from "All Users" to "Public (No Login Required)".Jun 26 2017, 2:25 PM