This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-08-11
1003. Acceptable definitions of mainSection: 6.10.3.1 [basic.start.main] Status: CD3 Submitter: Daniel Krügler Date: 2009-11-17[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]
The specification of the forms of the definition of main that an impliementation is required to accept is clear in C99 that the parameter names and the exact syntactic form of the types can vary. Although it is reasonable to assume that a C++ implementation would accept a definition like
int main(int foo, char** bar) { /* ... */ }
instead of the canonical
int main(int argc, char* argv[]) { /* ... */ }
it might be a good idea to clarify the intent using wording similar to C99's.
Proposed resolution (August, 2011):
Change 6.10.3.1 [basic.start.main] paragraph 2 as follows:
...All implementations shall allow both of the following definitions of main:
int main() { /* ... */ }and
int main(int argc, char* argv[]) { /* ... */ }
function of () returning int and
function of (int, pointer to pointer to char) returning int
as the type of main (9.3.4.6 [dcl.fct]. In the latter form , for purposes of exposition, the first function parameter is called argc and the second function parameter is called argv, whereargc shall be the number of arguments...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4