-
Notifications
You must be signed in to change notification settings - Fork 813
[cstdlib.syn] Add missing index entries and remove stray entries #9309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,67 +102,19 @@ | |
| \rSec2[cstdlib.syn]{Header \tcode{<cstdlib>} synopsis} | ||
|
|
||
| \indexheader{cstdlib}% | ||
| \indexlibraryglobal{EXIT_FAILURE}% | ||
| \indexlibraryglobal{EXIT_SUCCESS}% | ||
| \indexlibraryglobal{MB_CUR_MAX}% | ||
| \indexlibraryglobal{NULL}% | ||
| \indexlibraryglobal{RAND_MAX}% | ||
| \indexlibraryglobal{_Exit}% | ||
| \indexlibraryglobal{abort}% | ||
| \indexlibraryglobal{abs}% | ||
| \indexlibraryglobal{aligned_alloc}% | ||
| \indexlibraryglobal{at_quick_exit}% | ||
| \indexlibraryglobal{atexit}% | ||
| \indexlibraryglobal{atof}% | ||
| \indexlibraryglobal{atoi}% | ||
| \indexlibraryglobal{atol}% | ||
| \indexlibraryglobal{atoll}% | ||
| \indexlibraryglobal{bsearch}% | ||
| \indexlibraryglobal{calloc}% | ||
| \indexlibraryglobal{div}% | ||
| \indexlibraryglobal{div_t}% | ||
| \indexlibraryglobal{exit}% | ||
| \indexlibraryglobal{free}% | ||
| \indexlibraryglobal{getenv}% | ||
| \indexlibraryglobal{labs}% | ||
| \indexlibraryglobal{ldiv}% | ||
| \indexlibraryglobal{ldiv_t}% | ||
| \indexlibraryglobal{llabs}% | ||
| \indexlibraryglobal{lldiv}% | ||
| \indexlibraryglobal{lldiv_t}% | ||
| \indexlibraryglobal{malloc}% | ||
| \indexlibraryglobal{mblen}% | ||
| \indexlibraryglobal{mbstowcs}% | ||
| \indexlibraryglobal{mbtowc}% | ||
| \indexlibraryglobal{qsort}% | ||
| \indexlibraryglobal{quick_exit}% | ||
| \indexlibraryglobal{rand}% | ||
| \indexlibraryglobal{realloc}% | ||
| \indexlibraryglobal{size_t}% | ||
| \indexlibraryglobal{srand}% | ||
| \indexlibraryglobal{strtod}% | ||
| \indexlibraryglobal{strtof}% | ||
| \indexlibraryglobal{strtol}% | ||
| \indexlibraryglobal{strtold}% | ||
| \indexlibraryglobal{strtoll}% | ||
| \indexlibraryglobal{strtoul}% | ||
| \indexlibraryglobal{strtoull}% | ||
| \indexlibraryglobal{system}% | ||
| \indexlibraryglobal{wcstombs}% | ||
| \indexlibraryglobal{wctomb}% | ||
| \begin{codeblock} | ||
| namespace std { | ||
| using size_t = @\seebelow@; // freestanding | ||
| using div_t = @\seebelow@; // freestanding | ||
| using ldiv_t = @\seebelow@; // freestanding | ||
| using lldiv_t = @\seebelow@; // freestanding | ||
| using @\libglobal{size_t}@ = @\seebelow@; // freestanding | ||
| using @\libglobal{div_t}@ = @\seebelow@; // freestanding | ||
| using @\libglobal{ldiv_t}@ = @\seebelow@; // freestanding | ||
| using @\libglobal{lldiv_t}@ = @\seebelow@; // freestanding | ||
| } | ||
|
|
||
| #define NULL @\seebelow@ // freestanding | ||
| #define EXIT_FAILURE @\seebelow@ // freestanding | ||
| #define EXIT_SUCCESS @\seebelow@ // freestanding | ||
| #define RAND_MAX @\seebelow@ | ||
| #define MB_CUR_MAX @\seebelow@ | ||
| #define @\libmacro{NULL}@ @\seebelow@ // freestanding | ||
| #define @\libmacro{EXIT_FAILURE}@ @\seebelow@ // freestanding | ||
| #define @\libmacro{EXIT_SUCCESS}@ @\seebelow@ // freestanding | ||
| #define @\libmacro{RAND_MAX}@ @\seebelow@ | ||
| #define @\libmacro{MB_CUR_MAX}@ @\seebelow@ | ||
|
|
||
| namespace std { | ||
| // Exposition-only function type aliases | ||
|
|
@@ -181,33 +133,33 @@ | |
| [[noreturn]] void _Exit(int status) noexcept; // freestanding | ||
| [[noreturn]] void quick_exit(int status) noexcept; // freestanding | ||
|
|
||
| char* getenv(const char* name); | ||
| int system(const char* string); | ||
| char* @\libglobal{getenv}@(const char* name); | ||
| int @\libglobal{system}@(const char* string); | ||
|
|
||
| // \ref{c.malloc}, C library memory allocation | ||
| void* aligned_alloc(size_t alignment, size_t size); | ||
| void* calloc(size_t nmemb, size_t size); | ||
|
Comment on lines
140
to
141
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about these? No index entries?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| void free(void* ptr); | ||
| void free_sized(void* ptr, size_t size); | ||
| void free_aligned_sized(void* ptr, size_t alignment, size_t size); | ||
| void @\libglobal{free_sized}@(void* ptr, size_t size); | ||
| void @\libglobal{free_aligned_sized}@(void* ptr, size_t alignment, size_t size); | ||
| void* malloc(size_t size); | ||
| void* realloc(void* ptr, size_t size); | ||
|
Comment on lines
145
to
146
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here? No index entries?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| size_t memalignment(const void* p); // freestanding | ||
|
|
||
| double atof(const char* nptr); | ||
| int atoi(const char* nptr); | ||
| long int atol(const char* nptr); | ||
| long long int atoll(const char* nptr); | ||
| double strtod(const char* nptr, char** endptr); | ||
| int strfromd(char* s, size_t n, const char* format, double fp); | ||
| int strfromf(char* s, size_t n, const char* format, float fp); | ||
| int strfroml(char* s, size_t n, const char* format, long double fp); | ||
| float strtof(const char* nptr, char** endptr); | ||
| long double strtold(const char* nptr, char** endptr); | ||
| long int strtol(const char* nptr, char** endptr, int base); | ||
| long long int strtoll(const char* nptr, char** endptr, int base); | ||
| unsigned long int strtoul(const char* nptr, char** endptr, int base); | ||
| unsigned long long int strtoull(const char* nptr, char** endptr, int base); | ||
| size_t @\libglobal{memalignment}@(const void* p); // freestanding | ||
|
|
||
| double @\libglobal{atof}@(const char* nptr); | ||
| int @\libglobal{atoi}@(const char* nptr); | ||
| long int @\libglobal{atol}@(const char* nptr); | ||
| long long int @\libglobal{atoll}@(const char* nptr); | ||
| double @\libglobal{strtod}@(const char* nptr, char** endptr); | ||
| int @\libglobal{strfromd}@(char* s, size_t n, const char* format, double fp); | ||
| int @\libglobal{strfromf}@(char* s, size_t n, const char* format, float fp); | ||
| int @\libglobal{strfroml}@(char* s, size_t n, const char* format, long double fp); | ||
| float @\libglobal{strtof}@(const char* nptr, char** endptr); | ||
| long double @\libglobal{strtold}@(const char* nptr, char** endptr); | ||
| long int @\libglobal{strtol}@(const char* nptr, char** endptr, int base); | ||
| long long int @\libglobal{strtoll}@(const char* nptr, char** endptr, int base); | ||
| unsigned long int @\libglobal{strtoul}@(const char* nptr, char** endptr, int base); | ||
| unsigned long long int @\libglobal{strtoull}@(const char* nptr, char** endptr, int base); | ||
|
|
||
| // \ref{c.mb.wcs}, multibyte / wide string and character conversion functions | ||
| int mblen(const char* s, size_t n); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all of these: no index entries?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
@@ -238,14 +190,14 @@ | |
| constexpr long long int abs(long long int j); // freestanding | ||
| constexpr @\placeholder{floating-point-type}@ abs(@\placeholder{floating-point-type}@ j); // freestanding-deleted | ||
|
|
||
| constexpr long int labs(long int j); // freestanding | ||
| constexpr long long int llabs(long long int j); // freestanding | ||
| constexpr long int @\libglobal{labs}@(long int j); // freestanding | ||
| constexpr long long int @\libglobal{llabs}@(long long int j); // freestanding | ||
|
|
||
| constexpr div_t div(int numer, int denom); // freestanding | ||
| constexpr div_t @\libglobal{div}@(int numer, int denom); // freestanding | ||
| constexpr ldiv_t div(long int numer, long int denom); // freestanding; see \ref{library.c} | ||
| constexpr lldiv_t div(long long int numer, long long int denom); // freestanding; see \ref{library.c} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we normally put
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Index entries pointing to the same page are automatically merged by the indexing machinery. |
||
| constexpr ldiv_t ldiv(long int numer, long int denom); // freestanding | ||
| constexpr lldiv_t lldiv(long long int numer, long long int denom); // freestanding | ||
| constexpr ldiv_t @\libglobal{ldiv}@(long int numer, long int denom); // freestanding | ||
| constexpr lldiv_t @\libglobal{lldiv}@(long long int numer, long long int denom); // freestanding | ||
| } | ||
| \end{codeblock} | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We removed this here, but didn't add \libglobal below, it seems.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentional for all of the comments that you've left. All of the functions that have not received
\libglobalformatting are defined in some other place, such as https://eel.is/c++draft/c.mb.wcs#lib:mbstowcsWe don't usually add an index entry for forward declarations, and https://eel.is/c++draft/cstdlib.syn#1 explicitly exempts the functions defined in those other subclauses from receiving the "this does the same thing as in C" treatment.
I think indexing
mbstowcsin this place would be outright misleading because it would incorrectly imply that the function is defined in [cstdlib.syn] with "this does the C thing" treatment.