www.digitalmars.com         C & C++   DMDScript  

D.gnu - -Wno-unreachable-code has no effect

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;

Nov 14 2007