asm("ldr r6, [r0, #__cpp(offsetof(X, y))]\t\n");
我无法使用以下命令来编译上述内联装配线:
arm-linux-gnueabi-gcc -c -lm -pg -O1 -g -pipe -fno-common \
-fno-builtin -Wall -march=armv7-a -mfpu=neon -mfloat-abi=softfp \
-mthumb-interwork -mtune=cortex-a9
错误日志为:
{standard input}: Assembler messages:
{standard input}:74: Error: ']' expected -- \
`ldr r6,[r0,#__cpp(offsetof(VP8BitReader,buf_))]'
显然
__cpp
无法识别。有什么建议么? 最佳答案
看来__cpp
是关键字available for RealView assembler。
GNU工具链没有它,我建议使用Extended Asm语法将某些内容从C传递给内联汇编。