I am using LINT to check automatically generated C-sourcefiles. In these sourcefiles there is the use of those macros (simplified):
#define MACRO_CHECK(a, b, c) \
((a==b) ? b : (SET_VAR, c))
#define SET_VAR \
global_var = 0 \
In the code, these macros are used like this:
if ( (x==0) && (MACRO(var1,var2,var3)==0) )
{
//...
}
My LINT-analysis gives me the following message:
LINT Note 9007: side effects on right hand of logical operator
Since my Macro is writing a value to a global variable, the LINT-message itself is justified. However, because of architectural reasons, I know that I can ignore this message - because of this I want to exclude the macro from the check for Note 9007. Since I am usng autocode-generation, I have a hard time of injecting my LINT-comments (to disable the Lint-message) into the right place at the source file. A more clean approach would be, to exclude the macro from the check over my LINT-Ruleset. So I tried to add the following line to my LINT-ruleset:
-emacro((9007),MACRO_CHECK)
However, this doesn't do the trick, since this excludes the code of the macro itself from the check, but it does not include the logical operator &&
and so it still gives me the Note 9007.
Is there any way I can disable the error for all mesages which are somehow related to my macro?