Compiler warning: Unreachable code was reached

Bug #1581647 reported by kaputtnik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
Unassigned

Bug Description

Due to some compiler errors i had to delete the build directory and recompile from scratch. Th compiler founds then some warings like:

[ 38%] Building CXX object src/ui_fsmenu/CMakeFiles/ui_fsmenu.dir/internet_lobby.cc.o
In file included from /home/kaputtnik/widelands-repo/trunk/src/network/network.h:29:0,
                 from /home/kaputtnik/widelands-repo/trunk/src/network/internet_gaming.h:34,
                 from /home/kaputtnik/widelands-repo/trunk/src/ui_fsmenu/internet_lobby.h:28,
                 from /home/kaputtnik/widelands-repo/trunk/src/ui_fsmenu/internet_lobby.cc:20:
/home/kaputtnik/widelands-repo/trunk/src/network/network.h: In Elementfunktion »virtual const char* ProtocolException::what() const«:
/home/kaputtnik/widelands-repo/trunk/src/base/wexception.h:63:90: Warnung: throw will always call terminate() [-Wterminate]
 #define NEVER_HERE() throw WException(__FILE__, __LINE__, "Unreachable code was reached.")
/home/kaputtnik/widelands-repo/trunk/src/network/network.h:185:3: Anmerkung: bei Substitution des Makros »NEVER_HERE«
   NEVER_HERE();

Is this normal?

There are also warnings like:

Warnung: nonnull argument »this« compared to NULL [-Wnonnull-compare]
Warnung: this »if« clause does not guard... [-Wmisleading-indentation]

Attached file contains gathered warnings like the above. The known warnings like "format %p ...." are not included.

Related branches

Revision history for this message
kaputtnik (franku) wrote :
Revision history for this message
Miroslav Remák (miroslavr256) wrote :

It looks like these warnings were added in GCC 6. Are you using GCC 6?

Revision history for this message
GunChleoc (gunchleoc) wrote :

The whole point of the NEVER_HERE() macro is that that code is never reached. It is a safeguard against regression bugs.

I'll fix the other warnings.

Revision history for this message
kaputtnik (franku) wrote :

Yes gcc 6 is installed here.

So the warnings regard to NEVER_HERE() are normal?

Revision history for this message
GunChleoc (gunchleoc) wrote :

Yes, they are normal - annoying though.

Changed in widelands:
status: New → Fix Committed
milestone: none → build19-rc1
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.