error: call makes alias in function & error: pointer cast di

If you have a simple question and just want an answer.
malbahri
Member++
Posts: 19
Joined: Sun Mar 23, 2014 9:51 pm

error: call makes alias in function & error: pointer cast di

Post by malbahri »

Hi,

I am getting the below errors while compiling project
any hint to sort it out it seams compiler problem, because code working fine in Xcode
The errors as below:

error :call makes alias in function
error: pointer cast discards const qualifier

BR//
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1164
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

Pointers in XC have restrictions/special cases due to parallelism and shared memory to keep things thread safe (keeping track of aliasing, bounds checking etc.)

See section 5.2.4. https://www.xmos.com/download/private/X ... 28F%29.pdf

There is probably a pointer type for you to do what you want, except you will need to annotate the pointer type. There are lots of examples

The alternative is to call c functions (in a different file), and then you can do whatever you want (and get in to trouble) as per normal!
malbahri
Member++
Posts: 19
Joined: Sun Mar 23, 2014 9:51 pm

Post by malbahri »

Hi,

Thanks a lot call make alias have been resolved but using alias, but I am still getting errors for pointer cast discards const qualifier. I tried to use unsafe functions but it cause other errors. Also i tried to make different C source file but it was not the helpful. I hope I will be able to get fruther help if possible

BR//
User avatar
Ross
Verified
XCore Legend
Posts: 1185
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Are you trying to compile C code in an .xc file?
malbahri
Member++
Posts: 19
Joined: Sun Mar 23, 2014 9:51 pm

Post by malbahri »

Yes, there are some file i did it in C