This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 3.0.1 PATCH: Avoid link failure of Objective-C testsuite on Solaris2/Intel


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]