This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 3.0.1 PATCH: Avoid link failure of Objective-C testsuite on Solaris2/Intel
- To: Nicola Pero <nicola at brainstorm dot co dot uk>
- Subject: Re: 3.0.1 PATCH: Avoid link failure of Objective-C testsuite on Solaris2/Intel
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Date: Mon, 2 Jul 2001 21:24:48 +0200 (MEST)
- Cc: Stan Shebs <shebs at apple dot com>, ovidiu at cup dot hp dot com, gcc-patches at gcc dot gnu dot org
- References: <15164.56710.983332.403845@xayide.TechFak.Uni-Bielefeld.DE><Pine.LNX.4.21.0107021018530.1447-100000@nicola.brainstorm.co.uk>
Nicola Pero writes:
> Here is a complete patch fixing libobjc:
I've tried your patch on all configurations used to verify my patch to allow
a shared libobjc to work on Solaris
http://gcc.gnu.org/ml/gcc-patches/2001-06/msg01785.html
and it fixes all the testsuite differences between the static and shared
cases reported there, so it looks very good.
A few stylistic comments on the patch, though:
> +Mon Jul 2 10:45:36 2001 Nicola Pero <nicola@brainstorm.co.uk>
> +
> + * objc/objc-api.h (object_is_class), (object_is_meta_class):
Use
* objc/objc-api.h (object_is_class, object_is_meta_class):
> + Fixed.
Be more specific here (all patches are supposed to fix something, unless
adding a feature :-).
> object_is_class(id object)
> {
> - return CLS_ISCLASS((Class)object);
> + return (object != nil) && CLS_ISMETA (object->class_pointer);
Use
return ((object != nil) && CLS_ISMETA (object->class_pointer));
to match the GNU coding standards.
> static inline BOOL
> object_is_instance(id object)
> {
> - return (object!=nil)&&CLS_ISCLASS(object->class_pointer);
> + return (object != nil) && CLS_ISCLASS (object->class_pointer);
Likewise:
return ((object != nil) && CLS_ISCLASS (object->class_pointer));
> static inline BOOL
> object_is_meta_class(id object)
> {
> - return CLS_ISMETA((Class)object);
> + return (object != nil)
> + && !object_is_instance (object)
> + && !object_is_class (object);
> }
Likewise:
return ((object != nil)
&& !object_is_instance (object)
&& !object_is_class (object));
Btw, the whole file (objc/objc-api.h) is full of GCS violations. Would you
mind providing a patch (probably mainline only) to fix this?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE