PC lint error 19 "useless declaration "

I want to understand the solution for the PC lint error 19 "useless declaration". i am using a interrupt vector table, and calling the interrupts with required parameters. when i run for PC lint I am having the error 19 as shown below can some one help me in this ?

ifndef Int_HandlerIndAddr

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


#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      );\ 

function call in the same file as below

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 error message as below:

Int_HandlerIndAddr(TaskOs_CallTaskApp100ms, 0, ISR_NR_TASK_APP_100MS, ISR_PRIO_TASK_APP_100MS);

    107  Error 19: Useless Declaration

    107  Error 19: Useless Declaration

Int_HandlerIndAddr(TaskOs_CallTaskApp10ms, 0, ISR_NR_TASK_APP_10MS, ISR_PRIO_TASK_APP_10MS);

    111  Error 19: Useless Declaration

    111  Error 19: Useless Declaration


answered 4 days ago Michael Burr #1

From http://www.gimpel.com/html/pub/msg.txt (emphasis added):

19 Useless Declaration -- A type appeared by itself without an associated variable, and the type was not a struct and not a union and not an enum. A double semi-colon can cause this as in:

  int x;;

If you notice, your macro ends in a semi-colon and you add a semi-colon when you invoke the macro. Therefore the expanded code has a double semi-colon. Get rid of one of them (I'd suggest the one in the macro definition).

comments powered by Disqus