Re : Tasking Compiler v8.6

Mar 07, 2007 3 Replies

Hi, I am new user to Tasking, previously having spent my time with Keil and hence have the tendency to import my old programming idiosyncrasies over.



I have a question here. Is it possible to allocate a certain memory location to a pointer in Tasking? I have the following code :



unsigned int* Base; //base address pointer



Base = 0xE20000 //base address



*Base = 0xFF //content of base address

And I got the following error message : "pointer mismatch at '=' "



I was trying to allocate a fixed memory area, starting at 0xE20000 for certain data. Does anyone have any idea how this is done?



thanks for your help.



regards wombat.



On 6 Mar 2007 21:35:54 -0800, snipped-for-privacy@gmail.com wrote in comp.arch.embedded:

C and C++ (whichever you are trying to use) do not allow an integer value to be automatically converted to a pointer. You need to use a cast:

Base = (unsigned int *)0xE20000;

Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://c-faq.com/ comp.lang.c++ http://www.parashift.com/c++-faq-lite/alt.comp.lang.learn.c-c++ http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html

Hi jack,

"C and C++ (whichever you are trying to use) do not allow an integer value to be automatically converted to a pointer. "

Thanks, will try that out. I was actually able to pull this off with Keil, maybe they have automatic conversion steps or something.

regards Wombat

Its normally called 'non-conformance', but it could be that you didn't turn on all the trype checking.

Peter

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required