Skip to content

Commit 9e5cdb4

Browse files
Updated C6276
Updated to the new format
1 parent 09cd5af commit 9e5cdb4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docs/code-quality/c6276.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
---
22
description: "Learn more about: C6276"
33
title: C6276
4-
ms.date: 11/04/2016
4+
ms.date: 08/16/2022
55
ms.topic: reference
6-
f1_keywords: ["C6276"]
6+
f1_keywords: ["C6276", "CHAR_TO_WCHAR_CAST", "__WARNING_CHAR_TO_WCHAR_CAST"]
77
helpviewer_keywords: ["C6276"]
88
ms.assetid: 88f288da-da81-4d32-ab0f-be9d01a2606a
99
---
10-
# C6276
10+
# Warning C6276
1111

12-
**Warning C2676: CHAR to WCHAR cast(CHAR_TO_WCHAR_CAST)**\
13-
Example output:
1412
> Cast between semantically different string types: char* to wchar_t\*. Use of invalid string can lead to undefined behavior.
1513
16-
## Description
14+
This warning indicates a potentially incorrect cast from an ANSI string (`char_t*`) to a UNICODE string (`wchar_t *`).
1715

18-
This warning indicates a potentially incorrect cast from an ANSI string (`char_t*`) to a UNICODE string (`wchar_t *`). Because UNICODE strings have a character size of 2 bytes, this cast might yield strings that aren't correctly terminated. Using such strings with the `wcs*` library of functions could cause buffer overruns and access violations.
16+
## Remarks
17+
18+
Because UNICODE strings have a character size of 2 bytes, this cast might yield strings that aren't correctly terminated. Using such strings with the `wcs*` library of functions could cause buffer overruns and access violations.
19+
20+
Code analysis name: CHAR_TO_WCHAR_CAST
1921

2022
## Example
2123

0 commit comments

Comments
 (0)