Typedef cannot be used on pointers

Technical questions regarding the XTC tools and programming with XMOS.
samsonwilliams
Newbie
Posts: 1
Joined: Thu May 23, 2024 4:39 am

Typedef cannot be used on pointers

Post by samsonwilliams »

Hello,

I tried to use it like this:
typedef void * aatest;
or
typedef void* unsafe aatest;

Can't compile, please tell me how to use it correctly.
User avatar
Ross
Verified
XCore Expert
Posts: 985
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

You've not really said what you're trying to do (I note this is also a copy and paste from an old thread)

However, the code snippet below uses your typedef in a couple of ways in xc and compiles.

Code: Select all


typedef void* unsafe aatest;

aatest a(aatest y)
{
    unsafe
    {
        aatest x = y+1;
        return x;
    }
}

Hopefully that's useful.