EmbDev.net

Forum: ARM programming with GCC/GNU tools How to write ANY value


von A. S. (aleksazr)


Rate this post
useful
not useful
The original thread is here:
http://groups.google.com/group/comp.lang.c/browse_thread/thread/80273aca260b868b/f24544a6b409f165#f24544a6b409f165

Does someone know how to do this, in a non-portable way?
Maybe in-line asm?

Again, its not that important, I'm just curious.

TIA

von Andreas B. (Guest)


Rate this post
useful
not useful
I guess
1
*p = (proper cast here)p
 should do it in RISC load/store type architectures. They need the 
pointer in a register to store to it, so storing the pointer itself 
would not require an extra load or register.

Even with a cast I still get conversion warnings when the pointer is 
cast to a smaller type however.

von Johann (Guest)


Rate this post
useful
not useful
adr = char(*"ANY");

'nuff said

von A. S. (aleksazr)


Rate this post
useful
not useful
Andreas B. wrote:
> I guess
1
*p = (proper cast here)p
 should do it

Great idea! Thank you very much!
:)

von A. S. (aleksazr)


Rate this post
useful
not useful
Johann wrote:
> adr = char(*"ANY");
>
> 'nuff said

well, maybe for someone more experienced in C.
I get this: error: expected expression before 'char'

von Johann (Guest)


Rate this post
useful
not useful
Are you serious?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.