diff --git a/source/compatibility.tex b/source/compatibility.tex index 780de021a0..71128980f3 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -1741,413 +1741,10 @@ \indextext{library!C standard}% \pnum -This subclause summarizes the contents of the \Cpp standard library +This subclause summarizes the explicit changes in headers, +definitions, declarations, or behavior between the C standard library +in the C standard and the parts of the \Cpp standard library that were included from the C standard library. -It also summarizes the explicit changes in definitions, -declarations, or behavior from the C standard library -noted in other subclauses (\ref{headers}, \ref{support.types}, \ref{c.strings}). - -\pnum -The \Cpp standard library provides 51 standard macros from the C library, -as shown in Table~\ref{tab:diff.standard.macros}. - -\pnum -The header names (enclosed in -\tcode{<} -and -\tcode{>}) -indicate that the macro may be defined in more than one header. -All such definitions are equivalent (\ref{basic.def.odr}). - -\begin{floattable}{Standard macros}{tab:diff.standard.macros} -{lllll} -\hline - -\tcode{assert} & -\tcode{HUGE_VAL} & -\tcode{NULL } & -\tcode{SIGILL} & -\tcode{va_copy} \\ - -\tcode{BUFSIZ} & -\tcode{LC_ALL} & -\tcode{NULL } & -\tcode{SIGINT} & -\tcode{va_end} \\ - -\tcode{CLOCKS_PER_SEC} & -\tcode{LC_COLLATE} & -\tcode{NULL } & -\tcode{SIGSEGV} & -\tcode{va_start} \\ - -\tcode{EDOM} & -\tcode{LC_CTYPE} & -\tcode{NULL } & -\tcode{SIGTERM} & -\tcode{WCHAR_MAX} \\ - -\tcode{EILSEQ} & -\tcode{LC_MONETARY} & -\tcode{offsetof} & -\tcode{SIG_DFL} & -\tcode{WCHAR_MIN} \\ - -\tcode{EOF} & -\tcode{LC_NUMERIC} & -\tcode{RAND_MAX} & -\tcode{SIG_ERR} & -\tcode{WEOF } \\ - -\tcode{ERANGE} & -\tcode{LC_TIME} & -\tcode{SEEK_CUR} & -\tcode{SIG_IGN} & -\tcode{WEOF } \\ - -\tcode{errno} & -\tcode{L_tmpnam} & -\tcode{SEEK_END} & -\tcode{stderr} & -\tcode{_IOFBF} \\ - -\tcode{EXIT_FAILURE} & -\tcode{MB_CUR_MAX} & -\tcode{SEEK_SET} & -\tcode{stdin} & -\tcode{_IOLBF} \\ - -\tcode{EXIT_SUCCESS} & -\tcode{NULL } & -\tcode{setjmp} & -\tcode{stdout} & -\tcode{_IONBF} \\ - -\tcode{FILENAME_MAX} & -\tcode{NULL } & -\tcode{SIGABRT} & -\tcode{TMP_MAX} & \\ - -\tcode{FOPEN_MAX} & -\tcode{NULL } & -\tcode{SIGFPE} & -\tcode{va_arg} & \\ - - -\end{floattable} - -\pnum -The \Cpp standard library provides 45 standard values from the C library, -as shown in Table~\ref{tab:diff.standard.values}. - -\begin{floattable}{Standard values}{tab:diff.standard.values} -{llll} -\hline -\tcode{CHAR_BIT} & - \tcode{FLT_DIG} & - \tcode{INT_MIN} & - \tcode{MB_LEN_MAX} \\ -\tcode{CHAR_MAX} & - \tcode{FLT_EPSILON} & - \tcode{LDBL_DIG} & - \tcode{SCHAR_MAX} \\ -\tcode{CHAR_MIN} & - \tcode{FLT_MANT_DIG} & - \tcode{LDBL_EPSILON} & - \tcode{SCHAR_MIN} \\ -\tcode{DBL_DIG} & - \tcode{FLT_MAX} & - \tcode{LDBL_MANT_DIG} & - \tcode{SHRT_MAX} \\ -\tcode{DBL_EPSILON} & - \tcode{FLT_MAX_10_EXP} & - \tcode{LDBL_MAX} & - \tcode{SHRT_MIN} \\ -\tcode{DBL_MANT_DIG} & - \tcode{FLT_MAX_EXP} & - \tcode{LDBL_MAX_10_EXP} & - \tcode{UCHAR_MAX} \\ -\tcode{DBL_MAX} & - \tcode{FLT_MIN} & - \tcode{LDBL_MAX_EXP} & - \tcode{UINT_MAX} \\ -\tcode{DBL_MAX_10_EXP} & - \tcode{FLT_MIN_10_EXP} & - \tcode{LDBL_MIN} & - \tcode{ULONG_MAX} \\ -\tcode{DBL_MAX_EXP} & - \tcode{FLT_MIN_EXP} & - \tcode{LDBL_MIN_10_EXP}& - \tcode{USHRT_MAX} \\ -\tcode{DBL_MIN} & - \tcode{FLT_RADIX} & - \tcode{LDBL_MIN_EXP} & \\ -\tcode{DBL_MIN_10_EXP} & - \tcode{FLT_ROUNDS} & - \tcode{LONG_MAX} & \\ -\tcode{DBL_MIN_EXP} & - \tcode{INT_MAX} & - \tcode{LONG_MIN} & \\ \hline -\end{floattable} - -\pnum -The \Cpp standard library provides 15 standard types from the C library, -as shown in Table~\ref{tab:diff.standard.types}. - -\begin{floattable}{Standard types}{tab:diff.standard.types} -{llll} -\hline -\tcode{clock_t} & - \tcode{ldiv_t} & - \tcode{size_t } & - \tcode{va_list} \\ -\tcode{div_t} & - \tcode{mbstate_t} & - \tcode{size_t } & - \tcode{wctrans_t} \\ -\tcode{FILE} & - \tcode{ptrdiff_t} & - \tcode{size_t } & - \tcode{wctype_t} \\ -\tcode{fpos_t} & - \tcode{sig_atomic_t} & - \tcode{size_t } & - \tcode{wint_t } \\ -\tcode{jmp_buf} & - \tcode{size_t } & - \tcode{time_t} & - \tcode{wint_t } \\ \hline -\end{floattable} - - -\pnum -The \Cpp standard library provides 2 standard -\tcode{struct}s -from the C library, -as shown in Table~\ref{tab:diff.standard.structs}. - -\begin{floattable}{Standard structs}{tab:diff.standard.structs} -{ll} -\hline -\tcode{lconv} & \tcode{tm} \\ \hline -\end{floattable} - -\pnum -The \Cpp standard library provides 209 standard functions from the C library, -as shown in Table~\ref{tab:diff.standard.functions}. - -\begin{floattable}{Standard functions}{tab:diff.standard.functions} -{llllll} -\hline -\tcode{abort} & -\tcode{fmod} & -\tcode{iswalnum} & -\tcode{modf} & -\tcode{strlen} & -\tcode{wcscat} \\ -\tcode{abs} & -\tcode{fopen} & -\tcode{iswalpha} & -\tcode{perror} & -\tcode{strncat} & -\tcode{wcschr} \\ -\tcode{acos} & -\tcode{fprintf} & -\tcode{iswcntrl} & -\tcode{pow} & -\tcode{strncmp} & -\tcode{wcscmp} \\ -\tcode{asctime} & -\tcode{fputc} & -\tcode{iswctype} & -\tcode{printf} & -\tcode{strncpy} & -\tcode{wcscoll} \\ -\tcode{asin} & -\tcode{fputs} & -\tcode{iswdigit} & -\tcode{putc} & -\tcode{strpbrk} & -\tcode{wcscpy} \\ -\tcode{atan} & -\tcode{fputwc} & -\tcode{iswgraph} & -\tcode{putchar} & -\tcode{strrchr} & -\tcode{wcscspn} \\ -\tcode{atan2} & -\tcode{fputws} & -\tcode{iswlower} & -\tcode{puts} & -\tcode{strspn} & -\tcode{wcsftime} \\ -\tcode{atexit} & -\tcode{fread} & -\tcode{iswprint} & -\tcode{putwc} & -\tcode{strstr} & -\tcode{wcslen} \\ -\tcode{atof} & -\tcode{free} & -\tcode{iswpunct} & -\tcode{putwchar} & -\tcode{strtod} & -\tcode{wcsncat} \\ -\tcode{atoi} & -\tcode{freopen} & -\tcode{iswspace} & -\tcode{qsort} & -\tcode{strtok} & -\tcode{wcsncmp} \\ -\tcode{atol} & -\tcode{frexp} & -\tcode{iswupper} & -\tcode{raise} & -\tcode{strtol} & -\tcode{wcsncpy} \\ -\tcode{bsearch} & -\tcode{fscanf} & -\tcode{iswxdigit} & -\tcode{rand} & -\tcode{strtoul} & -\tcode{wcspbrk} \\ -\tcode{btowc} & -\tcode{fseek} & -\tcode{isxdigit} & -\tcode{realloc} & -\tcode{strxfrm} & -\tcode{wcsrchr} \\ -\tcode{calloc} & -\tcode{fsetpos} & -\tcode{labs} & -\tcode{remove} & -\tcode{swprintf} & -\tcode{wcsrtombs} \\ -\tcode{ceil} & -\tcode{ftell} & -\tcode{ldexp} & -\tcode{rename} & -\tcode{swscanf} & -\tcode{wcsspn} \\ -\tcode{clearerr} & -\tcode{fwide} & -\tcode{ldiv} & -\tcode{rewind} & -\tcode{system} & -\tcode{wcsstr} \\ -\tcode{clock} & -\tcode{fwprintf} & -\tcode{localeconv} & -\tcode{scanf} & -\tcode{tan} & -\tcode{wcstod} \\ -\tcode{cos} & -\tcode{fwrite} & -\tcode{localtime} & -\tcode{setbuf} & -\tcode{tanh} & -\tcode{wcstok} \\ -\tcode{cosh} & -\tcode{fwscanf} & -\tcode{log} & -\tcode{setlocale} & -\tcode{time} & -\tcode{wcstol} \\ -\tcode{ctime} & -\tcode{getc} & -\tcode{log10} & -\tcode{setvbuf} & -\tcode{tmpfile} & -\tcode{wcstombs} \\ -\tcode{difftime} & -\tcode{getchar} & -\tcode{longjmp} & -\tcode{signal} & -\tcode{tmpnam} & -\tcode{wcstoul} \\ -\tcode{div} & -\tcode{getenv} & -\tcode{malloc} & -\tcode{sin} & -\tcode{tolower} & -\tcode{wcsxfrm} \\ -\tcode{exit} & -\tcode{getwc} & -\tcode{mblen} & -\tcode{sinh} & -\tcode{toupper} & -\tcode{wctob} \\ -\tcode{exp} & -\tcode{getwchar} & -\tcode{mbrlen} & -\tcode{sprintf} & -\tcode{towctrans} & -\tcode{wctomb} \\ -\tcode{fabs} & -\tcode{gmtime} & -\tcode{mbrtowc} & -\tcode{sqrt} & -\tcode{towlower} & -\tcode{wctrans} \\ -\tcode{fclose} & -\tcode{isalnum} & -\tcode{mbsinit} & -\tcode{srand} & -\tcode{towupper} & -\tcode{wctype} \\ -\tcode{feof} & -\tcode{isalpha} & -\tcode{mbsrtowcs} & -\tcode{sscanf} & -\tcode{ungetc} & -\tcode{wmemchr} \\ -\tcode{ferror} & -\tcode{iscntrl} & -\tcode{mbstowcs} & -\tcode{strcat} & -\tcode{ungetwc} & -\tcode{wmemcmp} \\ -\tcode{fflush} & -\tcode{isdigit} & -\tcode{mbtowc} & -\tcode{strchr} & -\tcode{vfprintf} & -\tcode{wmemcpy} \\ -\tcode{fgetc} & -\tcode{isgraph} & -\tcode{memchr} & -\tcode{strcmp} & -\tcode{vfwprintf} & -\tcode{wmemmove} \\ -\tcode{fgetpos} & -\tcode{islower} & -\tcode{memcmp} & -\tcode{strcoll} & -\tcode{vprintf} & -\tcode{wmemset} \\ -\tcode{fgets} & -\tcode{isprint} & -\tcode{memcpy} & -\tcode{strcpy} & -\tcode{vsprintf} & -\tcode{wprintf} \\ -\tcode{fgetwc} & -\tcode{ispunct} & -\tcode{memmove} & -\tcode{strcspn} & -\tcode{vswprintf} & -\tcode{wscanf} \\ -\tcode{fgetws} & -\tcode{isspace} & -\tcode{memset} & -\tcode{strerror} & -\tcode{vwprintf} &\\ -\tcode{floor} & -\tcode{isupper} & -\tcode{mktime} & -\tcode{strftime} & -\tcode{wcrtomb} &\\ \hline -\end{floattable} \rSec2[diff.mods.to.headers]{Modifications to headers}