today I wanna try analyze my source code via PC-LINT. I configured PC lint for my compiler - RL78. And it seems like it works.
Meanwhile I added more files to analyze, and then I noticed one strange error.
error: 5448: token is not a valid binary operator in a preprocessor subexpression
Problem was found in #if condition:
#define Uart0_DivideWithRounding(A, B) ((TLong)( (A) / (B) + 0.5 ))
#define Uart0_CalculateDivisionRatio(lfsInputFrequency, lBaudRate) Uart0_DivideWithRounding((lfsInputFrequency)/2.0, lBaudRate)
#define dlUart0_CalculatedDivisionRatio0 Uart0_CalculateDivisionRatio(dfsUart0_InputFrequency0,dUart0_BaudRate)
#if dlUart0_CalculatedDivisionRatio0 > dUart0_DivisionRatioLimitHigh
I realized I have there casting and div of floating numbers. My compiler can handle that somehow... (IAR1.40.6 RL78)
Problem is that, I can't change anything in my source code, cuz this code is a part of company internal library.
Any suggestion how I can deal with it?
I tried to suppressed this error, but its not a solution. Pc lint cant process it, and go into #if condition and then to #error. Then pc-lint abort execution.
I tried to fined answer in compiler documentation, but without success.
I found the solution of my problem. This problematic makro can be overwriten in Pc-lint config file. In that way:
++ddlUart0_CalculatedDivisionRatio0=52