Cem Polat
Cem Polat

Reputation: 701

How to suppress PC-Lint Note 970 for int main(void) function?

I have a Visual Studio Windows Console application with ANSI C code. The main function definition is something like:

int main(void)
{
    // do stuff
    return 0;
}

However, PC-Lint reports the below message for the int type

Note 970: Use of modifier or type ⁡int⁢ outside of a typedef [MISRA 2012 Directive 4.6, advisory]

I need to keep both the int type for the main function and the Note 970. Therefore, I want to suppress Note 970 just for the main function definition. I don't want to put a //lint !e970 on the source code.

I would like to know if it is possible to suppress this message only for the definition of the main function with PC-Lint options.

Upvotes: 3

Views: 1247

Answers (1)

Lundin
Lundin

Reputation: 214730

Your tool is broken, report a bug to PC Lint.

Quoting MISRA-C:2012 Directive 4.6:

Exceptions:

For function main an int may be used rather than the typedefs as a return type. Therefore int main (void) is permitted.

Upvotes: 6

Related Questions