Skip to content

Commit 5420678

Browse files
Tyler WhitneyTyler Whitney
authored andcommitted
c conformance notes
1 parent 4da167c commit 5420678

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎docs/c-runtime-library/compatibility.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ ms.assetid: 346709cb-edda-4909-9a19-3d253eddb6b7
77
---
88
# Compatibility
99

10-
The Universal C Runtime Library (UCRT) supports most of the C standard library required for C++ conformance. It implements the C99 (ISO/IEC 9899:1999) library, with certain exceptions: strict type compatibility in \<complex.h>. The UCRT also implements a large subset of the POSIX.1 (ISO/IEC 9945-1:1996, the POSIX System Application Program Interface) C library. However, it's not fully conformant to any specific POSIX standard. The UCRT also implements several Microsoft-specific functions and macros that aren't part of a standard.
10+
The Universal C Runtime Library (UCRT) supports most of the C standard library required for C++ conformance. It implements the C99 (ISO/IEC 9899:1999) library, with certain exceptions:
11+
- strict type compatibility in \<complex.h>.
12+
- `aligned_alloc`, which will probably not be implemented because the Windows operating system doesn't support aligned allocations. Use the non-standard `_aligned_malloc`, instead.
13+
- `strerrorlen_s`
14+
- stdatomic.h
15+
- threads.h
16+
The UCRT also implements a large subset of the POSIX.1 (ISO/IEC 9945-1:1996, the POSIX System Application Program Interface) C library. However, it's not fully conformant to any specific POSIX standard. The UCRT also implements several Microsoft-specific functions and macros that aren't part of a standard.
1117

1218
Functions specific to the Microsoft implementation of Visual C++ are found in the vcruntime library. Many of these functions are for internal use and can't be called by user code. Some are documented for use in debugging and implementation compatibility.
1319

‎docs/c-runtime-library/reference/realloc.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "realloc"
3-
ms.date: "4/2/2020"
3+
description: "API reference for realloc(); which reallocates memory blocks."
4+
ms.date: "9/11/2020"
45
api_name: ["realloc", "_o_realloc"]
56
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-heap-l1-1-0.dll", "api-ms-win-crt-private-l1-1-0.dll"]
67
api_type: ["DLLExport"]
@@ -42,6 +43,9 @@ The return value points to a storage space that is guaranteed to be suitably ali
4243

4344
## Remarks
4445

46+
> [!NOTE]
47+
> **realloc** hasn't been updated to implement C17 behavior.
48+
4549
The **realloc** function changes the size of an allocated memory block. The *memblock* argument points to the beginning of the memory block. If *memblock* is **NULL**, **realloc** behaves the same way as **malloc** and allocates a new block of *size* bytes. If *memblock* is not **NULL**, it should be a pointer returned by a previous call to **calloc**, **malloc**, or **realloc**.
4650

4751
The *size* argument gives the new size of the block, in bytes. The contents of the block are unchanged up to the shorter of the new and old sizes, although the new block can be in a different location. Because the new block can be in a new memory location, the pointer returned by **realloc** is not guaranteed to be the pointer passed through the *memblock* argument. **realloc** does not zero newly allocated memory in the case of buffer growth.

0 commit comments

Comments
 (0)