uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(25):inline

 

快乐虾

http://blog.csdn.net/lights_joy/

lights@hb165.com

 

本文适用于

ADI bf561 DSP

优视BF561EVB开发板

uclinux-2008r1.5-rc3(smp patch)

Visual DSP++ 5.0(update 5)

 

欢迎转载,但请保留作者信息

 

有一个警告:

"../../linux-2.6.x/include/linux/compiler-gcc.h", line 29: cc0047: {D} warning:

          incompatible redefinition of macro "inline"

  #define inlineinline__attribute__((always_inline))

其指向的语句为:

#define inline         inline        __attribute__((always_inline))

这个问题的处理本身是很简单的,但是透过这个警告可以发现一些很有意思的东西。这个警告说的是inline宏重定义,但是这个警告却没有给出inline的前一个定义,这就是奇怪的地方,通常这种类型的警告信息都是这样的:

"../../linux-2.6.x/include/linux/kernel.h", line 101: cc0047: {D} warning:

          incompatible redefinition of macro "abs" (declared at line 89 of

          "E:/Program Files/Analog Devices/VisualDSP

          5.0/Blackfin/include/stdlib.h")

  #define abs(x) ({/

也就是说通常cc0047都会给出两个位置。

查一下vdsp中关于inline的说明:

The inline keyword directs the compiler to integrate the code for the function you declare as inline into the code of its callers. Inline function support and the inline keyword is a standard feature of C++; the ccblkfn compiler provides this keyword as a C extension.

由此可以肯定,vdsp编译器对inline的扩展是以预定义宏的方式实现,果然是个好主意,值得学习。

可以有几种办法处理这个警告:

第一种就是通过Project Options -> Compile -> Language Settings -> Disable Analog Devices extension keywords将所有扩展关闭,不过这样需要在每个项目都做设置,比较麻烦。而且既然使用了vdsp,又不用其扩展,似乎不通情理。

第二种方法是在此错误语句前加上#undef inline,关闭vdsp内部的inline定义。

第三种方法直接注释掉这行语句,使用vdsp的内部定义,这样可以通过Project Options里面对inline的选项对其进行控制。

在此选择第三种方法。

 

 

1       参考资料

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(1):前言(2009-1-12)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(2):代码注释(2009-1-12)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(3):vdsp项目创建(2009-1-12)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(4):目录差异(2009-1-12)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(5):'bf561.h'的问题(2009-1-12)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(6)CONFIG_BFIN_KERNEL_CLOCK(2009-1-12)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(7)CONFIG_MEM_MT48LC16M16A2TG_75(2009-1-12)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(8):CONFIG_CLKIN_HZ(2009-1-12)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(9):CONFIG_MEM_SIZE(2009-1-12)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(10):CONFIG_FLASH_SPEED_BTT(2009-1-13)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(11):__INIT(2009-1-13)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(12):trace_buffer_init(2009-1-13)

uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(13):ENDPROC(2009-1-13)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(14)__FINIT(2009-1-13)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(15)CONFIG_BANK_x(2009-1-13)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(16):使用head.s做为入口点(2009-1-13)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(17)__bss_start(2009-1-13)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(18)_sdata(2009-1-14)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(19)_stext(2009-1-14)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(20)bf53x_relocate_l1_mem(2009-1-14)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(21)dlb创建(2009-1-14)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(22)IRQ_PLL_WAKEUP(2009-1-14)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(23)PREEMPT_ACTIVE is too low(2009-1-14)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(24)Gcc版本号(2009-1-14)

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嵌云阁主

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值