Heh, useless warning silences

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Heh, useless warning silences

Post by Quark »

I just get warning «unreachable code» in water_cmd.c from this :) (line 337)

Code: Select all

	return 0; // useless but silences warning
and in default.c (331)

Code: Select all

	/* maybe useless, but avoids compiler warning this way */
	return INVALID_ENGINE;
Last edited by Quark on 25 Nov 2006 11:44, edited 1 time in total.
Image
User avatar
spaceman-spiff
Retired Moderator
Retired Moderator
Posts: 20634
Joined: 28 Jul 2002 07:08
Location: Belgium
Contact:

Post by spaceman-spiff »

I changed your topic title, please choose more wisely next time :P
Well, back to work, lot's of it in the near future
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

Quark: what compiler, version, OS, ...?
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

MSVC2005, warning level 4 :)
Image
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

Then you must see also lot of other warnings. Why did you ask for those two?

When the code will be ready for warning level 4 it will be set in the project files.
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

Intel compiler generates a lot of warnings even at level 3, and applied patches also generates warnings — i disable some (that popup about 1000 times) with additional switches

It just curious to see warning from code, that tries to disable it :)
Image
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

No. The silenced warning was different one: "Not all control paths return value". Probably before some other changes that happened there.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 13 guests