A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/1886.html below:

CWG Issue 1886

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-04-13

1886. Language linkage for main()Section: 6.9.3.1  [basic.start.main]     Status: CD4     Submitter: Richard Smith     Date: 2014-03-04

[Moved to DR at the May, 2015 meeting.]

There does not appear to be any restriction on giving main() an explicit language linkage, but it should probably be either ill-formed or conditionally-supported.

Proposed resolution (November, 2014):

  1. Change 6.9.3.1 [basic.start.main] paragraph 2 as follows:

  2. An implementation shall not predefine the main function. This function shall not be overloaded. It Its type shall have C++ language linkage and it shall have a declared return type of type int, but otherwise its type is implementation-defined. An implementation shall allow both...
  3. Change 6.9.3.1 [basic.start.main] paragraph 3 as follows:

  4. The function main shall not be used within a program. The linkage (6.6 [basic.link]) of main is implementation-defined. A program that defines main as deleted or that declares main to be inline, static, or constexpr is ill-formed. The main function shall not be declared with a linkage-specification (9.12 [dcl.link]). A program that declares a variable main at global scope or that declares the name main with C language linkage (in any namespace) is ill-formed. The name main is not otherwise reserved...

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