我在用ARM编译器编译android手机的调制解调器代码。
我发现了下面的错误:
function "typeof" declared implicitly然后我想我应该使用__typeof__。但我也犯了同样的错误:
function "__typeof__" declared implicitly我甚至试过__typeof。但它们都不起作用。
为什么?
编译器是RVDS 5.01。命令行包含在一些脚本中。
错误信息是:
"/opt2/huanglianjun/PD1401V-modem-1.2.1.c1/boot_images/core/storage/ext4/src/common/div64.h", line 47:
Error: #223-D: function "typeof" declared implicitly.守则是:
#define do_div(n,base) do{ \
uint32_t __base = (base); \
uint32_t __rem; \
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
if (((n) >> 32) == 0) { \
__rem = (uint32_t)(n) % __base; \
(n) = (uint32_t)(n) / __base; \
} else \
__rem = __div64_32(&(n), __base); \
__rem; \
}while(0)发布于 2015-08-13 08:33:36
如果我正确地阅读了文献资料,至少从RVDS3.0开始就支持typeof,但是您需要通过将--gnu标志传递给armcc来启用GNU模式。
https://stackoverflow.com/questions/31982546
复制相似问题