Changeset View
Changeset View
Standalone View
Standalone View
contrib/libc++/include/cstdio
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
int vsprintf(char* restrict s, const char* restrict format, va_list arg); | int vsprintf(char* restrict s, const char* restrict format, va_list arg); | ||||
int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99 | int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99 | ||||
int fgetc(FILE* stream); | int fgetc(FILE* stream); | ||||
char* fgets(char* restrict s, int n, FILE* restrict stream); | char* fgets(char* restrict s, int n, FILE* restrict stream); | ||||
int fputc(int c, FILE* stream); | int fputc(int c, FILE* stream); | ||||
int fputs(const char* restrict s, FILE* restrict stream); | int fputs(const char* restrict s, FILE* restrict stream); | ||||
int getc(FILE* stream); | int getc(FILE* stream); | ||||
int getchar(void); | int getchar(void); | ||||
char* gets(char* s); // removed in C++14 | |||||
int putc(int c, FILE* stream); | int putc(int c, FILE* stream); | ||||
dim: I'm not sure if this should be unconditional. If somebody insists on using C++11 or earlier… | |||||
emasteAuthorUnsubmitted Not Done Inline ActionsWell, in this review we've explicitly made gets unavailable, regardless of what ISO C or POSIX say, and the same argument applies to C++. emaste: Well, in this review we've explicitly made gets unavailable, regardless of what ISO C or POSIX… | |||||
int putchar(int c); | int putchar(int c); | ||||
int puts(const char* s); | int puts(const char* s); | ||||
int ungetc(int c, FILE* stream); | int ungetc(int c, FILE* stream); | ||||
size_t fread(void* restrict ptr, size_t size, size_t nmemb, | size_t fread(void* restrict ptr, size_t size, size_t nmemb, | ||||
FILE* restrict stream); | FILE* restrict stream); | ||||
size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb, | size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb, | ||||
FILE* restrict stream); | FILE* restrict stream); | ||||
int fgetpos(FILE* restrict stream, fpos_t* restrict pos); | int fgetpos(FILE* restrict stream, fpos_t* restrict pos); | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
using ::remove; | using ::remove; | ||||
using ::rename; | using ::rename; | ||||
using ::tmpfile; | using ::tmpfile; | ||||
using ::tmpnam; | using ::tmpnam; | ||||
#endif | #endif | ||||
#ifndef _LIBCPP_HAS_NO_STDIN | #ifndef _LIBCPP_HAS_NO_STDIN | ||||
using ::getchar; | using ::getchar; | ||||
#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_MSVCRT) | |||||
using ::gets; | |||||
#endif | |||||
using ::scanf; | using ::scanf; | ||||
using ::vscanf; | using ::vscanf; | ||||
#endif | #endif | ||||
#ifndef _LIBCPP_HAS_NO_STDOUT | #ifndef _LIBCPP_HAS_NO_STDOUT | ||||
using ::printf; | using ::printf; | ||||
using ::putchar; | using ::putchar; | ||||
using ::puts; | using ::puts; | ||||
using ::vprintf; | using ::vprintf; | ||||
#endif | #endif | ||||
_LIBCPP_END_NAMESPACE_STD | _LIBCPP_END_NAMESPACE_STD | ||||
#endif // _LIBCPP_CSTDIO | #endif // _LIBCPP_CSTDIO |
I'm not sure if this should be unconditional. If somebody insists on using C++11 or earlier, gets should be available, even if it is unwise to use. (The same could be said for e.g. strcpy and the like.)
If it is conditional on the C++ version, this change could also be upstreamed.