Re: Disabling some compiler warnings
Re: Disabling some compiler warnings
- Subject: Re: Disabling some compiler warnings
- From: Rainer Brockerhoff <email@hidden>
- Date: Fri, 20 Jul 2001 17:54:24 -0300
>
From: Graham Wihlidal <email@hidden>
>
Subject: Re: Disabling some compiler warnings
>
>
Yes there is. Go to your build target and select Build Settings.
>
Scroll down to the listbox with Expert Build Settings. In the
>
OTHER_CFLAGS field put -w
>
>
On Sunday, July 15, 2001, at 11:58 AM, email@hidden wrote:
>
> Is there a way to disable some unuseful warnings of the compiler? For
>
> instance, I have a class with:
>
>
>
> IBOutlet id delegate;
>
>
>
> and then in implementation:
>
>
>
> [delegate someAction];
>
>
>
> The compiler says:
>
> Warning: cannot find method
>
> Warning: return type for 'someAction' defaults to id
>
>
>
> Well how would it be possible to find a method for an 'id', anyway? If
>
> I declare the object as id, I already know that the compiler cannot
>
> check at runtime, so it is just noise. Moreover, I don't mind the
>
> return type, since I don't use it (the method is called as a procedure;
>
> actually it's a void one in my case). this is something that the
>
> compiler could check before issuing the warning!
Disabling all warnings seems a little extreme - sometimes the warnings _are_ meaningful.
In such a case, I usually cast the delegate to the class which implements "someAction":
[(theClass*)delegate someAction];
and the compiler is satisfied.
This also IMHO is somewhat more self-documenting...
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
In their own business even sages err."
http://www.brockerhoff.net/ (updated July 2000)