This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

有几个解决不出来的warning



各位大虾,

我在使用网上提供的Keystone资源的时候出现了几个warning,到现在也没有解决的办法,希望大家能帮帮忙.

Description Resource Path Location Type
        1.  enumerated type mixed with another type Keystone_Serdes_init.c /KeysoneEmif/common line 177 C/C++ Problem
        2.  function declared implicitly KeyStone_SRIO_Init_drv.c /KeysoneEmif/common line 1243 C/C++ Problem
        3.  shift count is too large KeyStone_SRIO_Init_drv.c /KeysoneEmif/common line 535 C/C++ Problem
        4.  trailing comma is nonstandard Keystone_I2C_init_drv.h /KeysoneEmif/common line 38 C/C++ Problem

第1个源程序是

                             serdes_cfg->linkSetup[i]->rxLos = 4;

第2个源程序是

                              if(uiRemote_In_ACK_ID)

                              printf("match_ACK_ID SP_ACKID_STAT=0x%x\n",srioRegs->RIO_SP[uiLocalPort].RIO_SP_ACKID_STAT);

第3个源程序是

                             (srio_message_map[i].dstProm<<CSL_SRIO_RIO_RXU_MAP_H_DEST_PROM_SHIFT)|

但是有很多和它同一格式的代码,别处都没有提示信息。。

第4个源程序是

                          typedef enum 

                                    {
                                            /** No blocking, the call exits after programmation of the
                                                 * control registers, interrupt service routine should be used.
                                             */
                                           I2C_NOWAIT = 0,

                                              /** Blocking Call, polling status flag until transfer complete.
                                                  */
                                           I2C_WAIT = 1,
                                    }I2C_Wait;

谢谢大家!!

   

  • 看不到代码上下文,只能猜测一下:
    问题1: ->rxLos可能是个枚举类型的数,你直接把一个整数赋值给它了
    问题2: 没有include <stdio.h>,所以编译器说 函数(应该是指printf)没声明
    问题3: 这个shift应该没问题,是不是"|"了另外一个shift有问题
    问题4: 修改下注释的格式,例如

    /*No blocking, the call exits after programmation of the
    control registers, interrupt service routine should be used. */