[previous] 0601 [next] [E] Function 'main()' is not of type 'int (void)' or 'int (int, char *[])'.
Language extensions REFERENCE - ISO:C90-5.1.2.2 Hosted environment

The "main" function has been defined in a non-standard form. According to the ISO:C Standard, there are only 2 acceptable ways in which the 'main' function may be defined in a hosted environment:

In the second form the function parameters may be named differently if desired.

For example:


/*PRQA S 2017 ++*/

void main(void) {                        /* Message 0601 */
    /*...*/
}

Note that in a freestanding environment the name and type of the function called at program startup are implementation-defined.


MISRA-C:2004 Rules applicable to message 0601:

Rule  1.1  (Required) All code shall conform to ISO/IEC 9899:1990 C programming language, ISO 9899, amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2: 1996192


QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents