Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mulle-nat opened this issue Sep 5, 2024 · 0 comments

Comments

@mulle-nat
Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant