Hi,
i want use uSTL library with FreeRTOS. When I compiling i get the error:
..ustl/uutility.h(356): error: #1113: Inline assembler not permitted when generating Thumb code
The code(linie 356 is: asm("":+g... ):
template <typename DEST, typename SRC> inline DEST noalias (const DEST&, SRC* s) { asm("":"+g"(s)::"memory"); union UPun { SRC s; DEST d; }; return (((UPun*)(s))->d); }
Do you have same idea how I can solve this problem?
The Real View Inline Assembler only supports ARM assembly, not thumb or thumb2.
http://www.keil.com/support/man/docs/armcc/armcc_bcfjdiaa.htm
It is usually better to use embedded assembler over inline.
I would suspect the code:
asm("":"+g"(s)::"memory");
is meant for another assembler (gnu?), but I could be wrong. Perhaps one of the ARM Assembler wizards on this board can help you more?
The uSTL docs say the following about noalias(): 'This template is to be used for dereferencing a type-punned pointer without a warning.' It appears that the implementation is extremely gcc-specific. Moreover, it is possible that the sole motivation for this function is gcc's warning 'dereferencing type-punned pointer will break strict-aliasing rules.' This could even not apply to RealView at all. I could be completely wrong about this, of course. I cannot decrypt the 'asm' line, it looks too cryptic. But it does appear that it is safe to just comment out this line to make the build complete. Just deal with it later...
For more details on this error:
http://www.keil.com/support/docs/3295.htm