in reply to Re: perlXS assignment from incompatible pointer type
in thread perlXS assignment from incompatible pointer type (works)

I've taken a look at your previous posts and indeed... So, OP, you'll have to learn about a pretty dumb feature of C (that has nothing to do with XS per se). There is a difference between
typedef struct Foo { ... } Foo;
and
typedef struct { ... } Foo;
In the first case, you can use struct Foo and Foo interchangeably. I think... Compatibility rules for types in C are pretty complex and obscure. Anyway, in the second case you don't have struct Foo, you have just Foo which is a name for an anonymous struct (while Foo in struct Foo is not a name but a tag). Yes, it's pretty confusing... but don't worry: there are some things in C that are a lot more obscure and error prone than that :) I suggest you to avoid typedefs for the time being.

Replies are listed 'Best First'.
Re^3: perlXS assignment from incompatible pointer type
by Anonymous Monk on Mar 23, 2016 at 10:14 UTC

    Regarding your first example: there's no compatibility problem. "A typedef declaration does not introduce a new type, only a synonym for the type so specified." If you didn't add qualifications, they are one and the same type (an alias).