Skip to content

Commit 8f602fd

Browse files
Updated C6328
Acrolinx
1 parent 805de45 commit 8f602fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/code-quality/c6328.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.assetid: e25b00fa-d344-4dc9-b322-b4f1ae06f315
1313
1414
## Remarks
1515

16-
Passing an argument of type `char` to C runtime, character-based routines named `is<xxx>` (e.g. `isspace`) can have unpredictable results. For example, an SBCS or MBCS single-byte character of type `char` with a value greater than `0x7F` is a negative value. If a `char` is passed, the compiler might convert the value to a signed `int` or a signed `long`. This value could be sign-extended by the compiler, with unexpected results. This could result in a function like `isspace`, which only expects values from 0-255 or `EOF`, being sent a negative value.
16+
Passing an argument of type `char` to C runtime, character-based routines named `is<xxx>` (for example, `isspace`) can have unpredictable results. For example, an SBCS or MBCS single-byte character of type `char` with a value greater than `0x7F` is a negative value. If a `char` is passed, the compiler might convert the value to a signed `int` or a signed `long`. This value could be sign-extended by the compiler, with unexpected results. This issue could result in a function like `isspace`, which only expects values from 0-255 or `EOF`, being sent a negative value.
1717

1818
Warning C6328 exists specifically to catch this bug. For characters in the 7-bit ASCII range, the cast is unnecessary. Characters outside that range can have unpredictable results such as program fault and termination.
1919

0 commit comments

Comments
 (0)