This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Find more ObjC methods


Devang Patel wrote:

And we are discussing in this
thread whether we should add new command line option to
enable 'wrong' compiler warnings. I do not approve such patch.

Why do you insist that the warning is wrong? (yes the wording was misleading but I'm sure there are others.) You are correct that ObjC doesn't have a notion of private methods. Yet the concept of privat methods has been achieved by a common convention in many implemations by not declaring them in @interfaces. This effectively made the declarations visible only to the current @implementation context. If the scope was intended to be global to the translation unit, then you declared it in an @interface local to the translation unit.


Now you have added a new "feature" that allows the compiler to find and use the correct prototype for a method used outside of the intended scope . Fine, or even good!

But why do you reject the feature of having a method private to the current @implementatin scope by the use of a wide spread convention! I know that ObjC doesn't formally support private methods, and I think it would be a waste of resources to try to implement something in the runtimes. All we're asking for is to give us back a warning when a method is being used outside of the scope it was intended for. In fact we're also offering to do the work.

Cheers,
David




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]