-Wno-unreachable-code has no effect

Kenny B funisher at gmail.com
Wed Nov 14 17:24:20 PST 2007


I found this today: It's annoying that I get that warning on correct
code and more annoying I can't suppress it... but it's only mild
annoyance :D -- this email is only for your information that this
problem exists, in case it's a part of a larger problem.

gdc -c -funittest -fversion=unittests -fdebug -g -fno-bounds-check
-Wall -Wextra -Wno-unreachable-code data.d -o obj/data.o
warning - Error: statement is not reachable

Here is the offending code:

class MyClass {
	
	Data data;
	struct Data {
		int x, y;
	}
	
	this(int x) {
		if(x) {
			x = 5;
		}
	}
}

Kenny


More information about the D.gnu mailing list