discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: Find more ObjC methods


From: Ziemowit Laski
Subject: Re: PATCH: Find more ObjC methods
Date: Mon, 6 Oct 2003 15:34:35 -0700


On Monday, Oct 6, 2003, at 15:14 US/Pacific, Alexander Malmberg wrote:

Ziemowit Laski wrote:
On Sunday, Oct 5, 2003, at 07:52 US/Pacific, Alexander Malmberg wrote:
2. Warning. Should the compiler warn when a method declared only in an
@implementation is used outside that @implementation?
[snip]
(2) is a convention, but a very useful convention, and it's used a lot
in eg. GNUstep.

And what does this convention buy you?  You wind up warning about
methods
that are _always_ available!  :-)

?

I'm not really sure if this statement is intended as a joke, as the
smilie implies, or not. Do I need to explain why conventions, in
addition to what the language enforces, and with help from the compiler
in following them, are a good thing?

You do if your conventions rely on buggy compiler behavior. In this case,
you are asking that the compiler ignore a method that is in plain sight
and pretend that it is not there.  What could possibly be the benefit of
this?


[snip]
Perhaps in the future,

Is there any good reason why it can't be done now?

If you can engineer a patch which, when say, '-Wprivate-methods' is specified, generates an aptly-worded warning, I'd personally have no objections (even though I still have absolutely no clue as to why this would be useful to anyone).


when we unify the the ..._INTERFACE_TYPE and
..._IMPLEMENTATION_TYPE
data structures, we can also define a METHOD_HAS_PROTOTYPE() bit in
..._METHOD_DECL, and you
guys could key off of that to generate the (newly-worded) warning?
This would have to be
enabled via a flag, since our resident NeXTies would almost certainly
_not_ want to see this
warning. :-(

They see it now, so I don't think it'd kill them to keep seeing it. :)

To the extent that they are seeing it now, it is clearly a bug, since the
warning says 'foo may not respond to bar', even though foo absolutely,
positively responds to bar in this case.

--Zem
--------------------------------------------------------------
Ziemowit Laski                 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group        Cupertino, CA USA  95014-2083
Apple Computer, Inc.           +1.408.974.6229  Fax .5477





reply via email to

[Prev in Thread] Current Thread [Next in Thread]