Re: Obj-C question: protocol usage and inheritance
Re: Obj-C question: protocol usage and inheritance
- Subject: Re: Obj-C question: protocol usage and inheritance
- From: Nicola Pero <email@hidden>
- Date: Tue, 17 Sep 2002 23:18:43 +0100 (BST)
>
>> If someone from Apple from the compiler group can reply to this, I would
>
>> appreciate. My opinion is that a class should be said to conform to a
>
>> formal protocol if it adopts the protocol **by implementation or
>
>> inheritance** or inherits from a class that adopts it. I don't think it
>
>> would break any existing code if the compiler could be changed (fixed?)
>
>> to support that definition. Did I mention that even if I have warnings,
>
>> this code works perfectly well at run time?
>
>
>
> Please read the documentation for the -Wno-protocol compiler switch.
>
>
But is it too much to ask from the compiler to look whether the
>
"missing method" is declared in the superclass(es) before issueing the
>
warning ?
From the GCC 3.3 documentation:
"-Wno-protocol: If a class is declared to implement a protocol, a warning
is issued for every method in the protocol that is not implemented by the
class. The default behaviour is to issue a warning for every method not
explicitly implemented in the class, even if a method implementation is
inherited from the superclass. If you use the -Wno-protocol option, then
methods inherited from the superclass are considered to be implemented,
and no warning is issued for them."
If you think you don't like the default behaviour and prefer the other
one, simply use the -Wno-protocol flag to get it. :-)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.