PC lint错误19"无用的声明"

时间:2018-04-17 04:39:13

标签: c static embedded error-suppression

我想了解PC lint错误的解决方案19"无用的声明"。我正在使用中断向量表,并使用所需的参数调用中断。当我运行PC lint时,我有错误19,如下所示,有人可以帮助我吗?

ifndef Int_HandlerIndAddr

#define Int_HandlerIndAddr(Isr,CpuNr,IntNr,Prio)Int_HandlerIndAddr2(Isr,CpuNr,IntNr,Prio)

ENDIF

#define Int_HandlerIndAddr2(Isr, CpuNr, IntNr, Prio) \
__asm__ (".ifndef .intr2.entry.include                        \n"\
        ".altmacro                                           \n"\
        ".macro .int2_entry.2 intEntryLabel, Prio, name # define the section and inttab entry code \n"\
        "   .pushsection .\\intEntryLabel,\"ax\",@progbits   \n"\
        "   __\\intEntryLabel :                              \n"\
        "       bisr    Prio                                 \n"\
        "       movh.a  %a14, hi:\\name                      \n"\
        "       lea     %a14, [%a14]lo:\\name                \n"\
        "       ji      %a14                                 \n"\
        "   .popsection                                      \n"\
        ".endm                                               \n"\
        ".macro .int2_entry.1 IntNr,Prio,CpuNr,u,name           \n"\
    ".int2_entry.2 intvec_tc\\CpuNr\\u\\IntNr,%(Prio),(name) # build the unique name \n"\
        ".endm                                               \n"\
        "                                                    \n"\
        ".macro .intr2.entry name,CpuNr,IntNr,Prio           \n"\
            ".int2_entry.1 %(IntNr),%(Prio),%(CpuNr),_,name # evaluate the priority and the cpu number \n"\
        ".endm                                               \n"\
        ".intr2.entry.include:                                \n"\
        ".endif                                              \n"\
        ".intr2.entry "#Isr","#CpuNr","#IntNr","#Prio      );\ 

函数调用与下面相同的文件

Int_HandlerIndAddr(TaskOs_CallTaskApp10ms, 0, ISR_NR_TASK_APP_10MS, ISR_PRIO_TASK_APP_10MS);

Int_HandlerIndAddr(TaskOs_CallTaskApp1ms, 0, ISR_NR_TASK_APP_1MS, ISR_PRIO_TASK_APP_1MS);

PC lint错误消息如下:

Int_HandlerIndAddr(TaskOs_CallTaskApp100ms, 0, ISR_NR_TASK_APP_100MS, ISR_PRIO_TASK_APP_100MS);

C:...\0_Src\0_AppSw\Tricore\BSW\Setup\IntVecTab.c 
    107  Error 19: Useless Declaration

C:..\0_Src\0_AppSw\Tricore\BSW\Setup\IntVecTab.c 
    107  Error 19: Useless Declaration

Int_HandlerIndAddr(TaskOs_CallTaskApp10ms, 0, ISR_NR_TASK_APP_10MS, ISR_PRIO_TASK_APP_10MS);

C:......\0_Src\0_AppSw\Tricore\BSW\Setup\IntVecTab.c 
    111  Error 19: Useless Declaration

C:.....\0_Src\0_AppSw\Tricore\BSW\Setup\IntVecTab.c 
    111  Error 19: Useless Declaration

1 个答案:

答案 0 :(得分:2)

来自http://www.gimpel.com/html/pub/msg.txt(强调补充):

  

19无用宣言 - 一种类型本身没有出现         一个关联的变量,类型不是结构和         不是联盟而不是枚举。 双分叉可以         导致这个,如:

  int x;;

如果您注意到,您的宏以分号结尾,并在调用宏时添加分号。因此,扩展代码具有双分号。摆脱其中一个(我建议宏定义中的那个)。