EmbDev.net

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


Author: A. S. (aleksazr)
Posted on:

Rate this post
0 useful
not useful
The original thread is here:
http://groups.google.com/group/comp.lang.c/browse_...

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

Author: Andreas B. (Guest)
Posted on:

Rate this post
0 useful
not useful
I guess
*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.

Author: Johann (Guest)
Posted on:

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

'nuff said

Author: A. S. (aleksazr)
Posted on:

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

Great idea! Thank you very much!
:)

Author: A. S. (aleksazr)
Posted on:

Rate this post
0 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'

Author: Johann (Guest)
Posted on:

Rate this post
0 useful
not useful
Are you serious?

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.