Jonathan Ben Avraham wrote:
Dear linux-il list,
g++ seems to be quite happy to compile and link a program that has a class that includes method declarations that are not implemented, as log as those methods are not called explicitly in the code. VS2008 seems to be able to discover this, either at compile or link time. Any way to do this in g++?
Thanks,

 - yba

I'm not sure the VS2008 behavior is the standard. Declaring a method in a class and not defining it is the same "offense" as declaring a function and not defining it, both from the technical and from the conceptual perspective.

More to the point - I'm not aware of such a flag for g++. I'm not sure where such a flag should even come, as the compiler should never be the one to do it (how will it know it is not defined in some other compilation unit?), and the linker cannot (how does it know a function was defined if noone was using it?).

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to