mulle-objc-runtime icon indicating copy to clipboard operation
mulle-objc-runtime copied to clipboard

You can't have opaque struct pointers in the @interface, if the @implementation knows the struct

Open mulle-nat opened this issue 1 year ago • 0 comments

struct opaque_struct;

@interface Foo
{
   struct opaque_struct  *p;  // will signature to ^{opaque_struct=}
}
@end


@implementation Foo

+ (Class) class
{
   return( self);
}

@end


// no longer opaque
struct opaque_struct
{
   int  foo;
};


@interface Bar
{
   struct opaque_struct  *p;  // will signature to ^{opaque_struct=i}
}
@end


@implementation Bar

+ (Class) class
{
   return( self);
}

@end

Thoughts

  • this is fine (?)
  • use a category to separate non-opaque knowledge
  • the @encode for pointers should be opaque in all cases

mulle-nat avatar Sep 05 '24 13:09 mulle-nat