In embedded systems you will need to implement certain functions that the operating system gives you (like _sbrk
, _read
, etc.) for standard library functions like malloc
and printf
.
If you take care of that I don't see a reason for your code not to work so long as you take GREAT CARE in how you write it. By GREAT CARE, I mean be very careful with floating points, processor word size and any other things that are not common between your desired targets.
Short answer: possible, but not easy.