www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



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;
		}
	}
}

Kenny
Nov 14 2007