Annex C (informative) Compatibility [diff]

C.8 C standard library [diff.library]


C.8.1 General [diff.library.general]

C.8.2 Modifications to headers [diff.mods.to.headers]

C.8.3 Modifications to definitions [diff.mods.to.definitions]

C.8.3.1 Types char8_t, char16_t, and char32_t [diff.char16]

C.8.3.2 Type wchar_t [diff.wchar.t]

C.8.3.3 Header <iso646.h> [diff.header.iso646.h]

C.8.3.4 Macro NULL [diff.null]

C.8.4 Modifications to declarations [diff.mods.to.declarations]

C.8.5 Modifications to behavior [diff.mods.to.behavior]

C.8.5.1 General [diff.mods.to.behavior.general]

C.8.5.2 Macro offsetof(type, member-designator) [diff.offsetof]

C.8.5.3 Memory allocation functions [diff.malloc]


C.8.1 General [diff.library.general]

Subclause [diff.library] summarizes the explicit changes in headers, definitions, declarations, or behavior between the C standard library in the C standard and the parts of the C++ standard library that were included from the C standard library.

C.8.3 Modifications to definitions [diff.mods.to.definitions]

C.8.3.1 Types char8_t, char16_t, and char32_t [diff.char16]

The types char8_t, char16_t, and char32_t are distinct types rather than typedefs to existing integral types.

The tokens char8_t, char16_t, and char32_t are keywords in C++ ([lex.key]).

They do not appear as macro or type names defined in .

C.8.3.2 Type wchar_t [diff.wchar.t]

The type wchar_t is a distinct type rather than a typedef to an existing integral type.

The token wchar_t is a keyword in C++ ([lex.key]).

It does not appear as a macro or type name defined in any of , , or .

C.8.3.4 Macro NULL [diff.null]

The macro NULL, defined in any of , , , , , , or , is an implementation-defined null pointer constant in C++ ([support.types]).

C.8.4 Modifications to declarations [diff.mods.to.declarations]

Header : The following functions have different declarations:

  • strchr
  • strpbrk
  • strrchr
  • strstr
  • memchr

Header : The following functions have different declarations:

  • wcschr
  • wcspbrk
  • wcsrchr
  • wcsstr
  • wmemchr

Header declares the names nullptr_t, byte, and to_integer, and the operators and operator templates in [support.types.byteops], in addition to the names declared in in the C standard library.

C.8.5 Modifications to behavior [diff.mods.to.behavior]

C.8.5.1 General [diff.mods.to.behavior.general]

Header : The following functions have different behavior:

  • atexit
  • exit
  • abort

Header : The following functions have different behavior:

  • longjmp

C.8.5.2 Macro offsetof(type, member-designator) [diff.offsetof]

The macro offsetof, defined in , accepts a restricted set of type arguments in C++.

C.8.5.3 Memory allocation functions [diff.malloc]

The functions aligned_alloc, calloc, malloc, and realloc are restricted in C++.

Subclause [c.malloc] describes the changes.