[OGo-GNUstep-Port] gcc 3 warnings

Filip Van Raemdonck gnustep-port@opengroupware.org
Fri, 18 Jul 2003 23:19:49 +0200


Hi,

Gcc 3 is a bit more picky about some things, and some of the complaints it
has go like this:

SoHTTPAuthenticator.m: In function `-[SoHTTPAuthenticator authRealm]':
SoHTTPAuthenticator.m:45: warning: multiple declarations for method `name'
/usr/lib/gcc-lib/i386-linux/3.3.1/include/objc/Object.h:59: warning: using `-(const char *)name'
/usr/lib/GNUstep/System/Headers/NGMime/NGMimeHeaderFields.h:58: warning: also found `-(NSString *)name'
/usr/lib/GNUstep/System/Headers/NGExtensions/EOGrouping.h:82: warning: also found `-(NSString *)name'
/usr/lib/GNUstep/System/Headers/Foundation/NSTimeZone.h:66: warning: also found `-(NSString *)name'
/usr/lib/GNUstep/System/Headers/Foundation/NSHost.h:68: warning: also found `-(NSString *)name'
/usr/lib/GNUstep/System/Headers/Foundation/NSNotification.h:52: warning: also found `-(NSString *)name'
../NGObjWeb/WOApplication.h:64: warning: also found `-(NSString *)name'
/usr/lib/GNUstep/System/Headers/Foundation/NSException.h:61: warning: also found `-(NSString *)name'
SoHTTPAuthenticator.m:45: warning: return from incompatible pointer type

Now there are depending on the situation two or one solutions to get rid
of these, AFAICT.

The first is, where messages are sent which are defined in OGo specific
classes, not to use too generic names for these methods so that they don't
clash with others.
The second is typecasting the recievers to the class from which the
desired method is.

For new methods, IMHO it's a good idea to use the first solution as it has
the added benefit of (usually) making it easier to go find out where a
specific method comes from when reading some code.
However, it's a lot of work to change that through out an entire source
tree, and it's error prone.

So, would it be ok to typecast receivers as per the second solution to
fix these warnings? Any objections?


Regards,

Filip

-- 
"From a security perspective, Bluetooth is a disaster waiting to happen."
	-- Martin Reynolds