Section: 30.12 [c.files] Status: NAD Submitter: Jeffrey Yasskin Opened: 2011-03-23 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [c.files].
View all issues with NAD status.
People often define structs and classes with fields named stdin, stdout, or stderr. According to 30.12 [c.files], though, these are macros.glibc defines them to themselves, allowing their non-portable use as field names, while the Mac OS X libc defines them to either __stdoutp or (&__sF), etc depending on __DARWIN_UNIX03. It's possible to allow their use while, as far as I can see, only requiring minor changes to various libc's, so C++1x should allow it.
[ 2011 Bloomington ]
Closed as NAD. This is an extension request that has been an issue for over 20 years. Supporting the extension would place a burden on the underlying C library that we may not be in a position to influence.
This wording is relative to the FDIS.
In 30.12 [c.files] add "stderr", "stdin", and "stdout" to a new Values section in Table 134 — Header <cstdio> synopsis:
134 — Header <cstdio> synopsis Type Name(s) Macros: BUFSIZ FOPEN_MAX SEEK_CUR TMP_MAX _IONBF stdout EOF L_tmpnam SEEK_END _IOFBF stderr FILENAME_MAX NULL <cstdio> SEEK_SET _IOLBF stdin Types: FILE fpos_t size_t <cstdio> Functions: …
Add a new paragraph after paragraph 2 as indicated:
2 Calls to the function tmpnam with an argument of NULL may introduce a data race (188.8.131.52) with other calls to tmpnam with an argument of NULL.
See also: ISO C 7.9, Amendment 1 4.6.2.
In C.6 [diff.library] add "stderr", "stdin", and "stdout" to Table 150 — Standard values:
Table 150 — Standard values CHAR_BIT FLT_DIG INT_MIN MB_LEN_MAX … … … … SHRT_MIN … … … … … … … … … … … … UCHAR_MAX …