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

And what about the definition of struct TM_PageTranslation? For all we know there is no such struct... Maybe it's something like
typedef struct { ... } TM_PageTranslation;
If so, remove struct from typedef struct TM_PageTranslation * T_PageTranslation. That's the most likely cause of error, IMO.

If that doesn't work, try to post SSCCE. See sscce.org for details.

Replies are listed 'Best First'.
Re^2: perlXS assignment from incompatible pointer type
by Anonymous Monk on Mar 23, 2016 at 01:13 UTC
    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.

      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).

Re^2: perlXS assignment from incompatible pointer type
by kopolov (Acolyte) on Mar 23, 2016 at 08:52 UTC
    You're a genius :) Thank you !!! Removed "struct" (and thanks for the lesson in structs)