Why function prototypes are they required in MISRA:2012?
问题 I am wondering why function prototypes are required by MISRA:2012. In the example below, the two prototypes aren't really necessary. #include <stdio.h> #include <stdlib.h> // >>> Truly useless in my opinion void display(void); int main(void); // <<< void display(void) { printf("Hello World!\n"); } int main() { display(); return EXIT_SUCCESS; } The rationale I can read on SO such as here isn't very clear to me. For instance, if main tries to access display before it is declared, the compiler