[Top][All Lists]

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

Re: New warnings (hopefully) in gcc 3.4

From: Nicola Pero
Subject: Re: New warnings (hopefully) in gcc 3.4
Date: Mon, 1 Sep 2003 12:28:15 +0100 (BST)

Thanks.  At a quick look through your output, the following stands out as
not particularly convincing:

NSMenu.m: In function `-[NSMenu update]':

NSMenu.m:804: warning: multiple methods named `-validateMenuItem:' found
../Headers/AppKit/NSMenu.h:562: warning: could be using 
`-(BOOL)validateMenuItem:(id <NSMenuItem>)menuItem'
../Headers/AppKit/NSMenu.h:567: warning: or 
`-(BOOL)validateMenuItem:(NSMenuItem *)aMenuItem'
NSMenu.m:804: warning: (Messages matching multiple method prototypes
NSMenu.m:804: warning: will be assumed to return `id' and accept
NSMenu.m:804: warning: `...' as arguments.)
NSMenu.m:804: warning: assignment makes integer from pointer without a cast

It seems there are two method definitions, both taking an object argument,
and returning a BOOL.

They differ in the details of the class/protocol declared for the object
argument, which is only used to do compile time type-checking, but should 
not affect generated code.

It's uncertain how type-checking is to be done for the object argument
(and the compiler is right to complain in that respect), but it's obvious
that the method call should be compiled as taking an object argument and
returning a BOOL, since both declarations agree on that.

But if I read the compiler warnings correctly, the compiler says it's
using 'id' as return type instead of BOOL!  It doesn't sound like the
right decision for the compiler to take.  I think it should recognize that
the method signatures are actually the same.  :-)

Sorry to be picky, but since you're putting the things in order, it might
be worth putting this one in order too :-)

reply via email to

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