/** * @file

Canonical main() signature

*/
#define LEGACY_BAGGAGE
#define ADOPTING_MODERN_AVOIDING_HYPE
#define MEME
Axiom 1
Unnecessary (!) global variables are evil.
Definition 1 : legacy C style main() function with arguments signature
int main(int argc, char** argv)
Definition 2 : const-correct main() function with arguments signature
int main(const int argc, char const * const * const argv)
Theorem 1
Any non-const function parameter is global variable within function body.
Theorem 2
Using legacy C style main() function with arguments signature is almost always (!) evil.
Theorem 3
Using const-correct main() function with arguments signature is much less evil (for certain values of much).

Any non-obvious theorems are to be proved as homework.

Codification of main()

Signature of program entry point - it's main function is defined in standard identically for C++ 1998, 2003, 2011.
ISO/EIC 14882 3.6.1 2

... It [main function] shall have a return type of type int, but otherwise its type is implementation-defined. All implementations shall allow both of the following definitions of main:

int main() { /* ... */ }
and
int main(int argc, char* argv[]) { /* ... */ }

Does holy ISO/EIC 14882 really say evil is omnipresent and doom inevitable?!

That was real close but hell no!

Const and volatile qualifiers in function signatures

Hidden in large tome of ISO/EIC 14882 is the magical fine-print: const in function signature does not count when function type matters.

ISO/EIC 14882:1998 8.3.5 3

... The type of a function is determined using the following rules. The type of each parameter is determined from its own decl-specifier-seq and declarator. ... Any cv-qualifier modifying a parameter type is deleted. [Example: the type void(*)(const int) becomes void(*)(int) -end example] Such cv-qualifiers affect only the definition of the parameter within the body of the function; they do not affect the function type. ...

ISO/EIC 14882:2011 8.3.5 5

... After producing the list of parameter types, any top-level cv-qualifiers modifying a parameter type are deleted when forming the function type. ...

Since const qualifiers are effectively ignored here const-correct main() function with arguments signature is compliant with standard prescribed signature.

Moral