Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix learn-build-service bot issues
  • Loading branch information
Rastaban committed Mar 9, 2023
commit 62210bb7a46e2305fcdd36af3f3d14f919a91401
2 changes: 1 addition & 1 deletion docs/code-quality/c28308.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description: "Learn more about: Warning C28308"
title: Warning C28308
ms.date: 03/07/2023
f1_keywords: ["C28308", ", "BAD_FORMAT_ARGUMENT_POSITION", "__WARNING_BAD_FORMAT_ARGUMENT_POSITION"]
f1_keywords: ["C28308", "BAD_FORMAT_ARGUMENT_POSITION", "__WARNING_BAD_FORMAT_ARGUMENT_POSITION"]
helpviewer_keywords: ["C28308"]
---
# Warning C28308
Expand Down
10 changes: 5 additions & 5 deletions docs/code-quality/c6065.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
description: "Learn more about: Warning C6065"
title: Warning C6065
ms.date: 2/22/2023
f1_keywords: ["C6063", "MISSING_COUNTED_STRING_ARGUMENT_TO_FORMAT_FUNCTION", "__MISSING_COUNTED_STRING_ARGUMENT_TO_FORMAT_FUNCTION"]
helpviewer_keywords: ["C6063"]
f1_keywords: ["C6065", "MISSING_COUNTED_STRING_ARGUMENT_TO_FORMAT_FUNCTION", "__MISSING_COUNTED_STRING_ARGUMENT_TO_FORMAT_FUNCTION"]
helpviewer_keywords: ["C6065"]
---
# Warning C6063
# Warning C6065

> warning C6065: Missing pointer to '*string type*' argument to '*function*' that corresponds to argument 'number'

## Remarks

This warning indicates that there is a mismatch between the format specifiers in a string and the types of the associated parameters. The format specifier indicates that at least one of the mismatched arguments should be a counted string such as `UNICODE_STRING` or `ANSI_STRING` but it not. This defect can cause crashes, buffer overflows, and potentially incorrect output.

To fix this warning, determine if the format specifier or the argument matches the intended behavior and modify the other to match. When modifying the format specifier for a counted string, it is recommended to explicitly use the size prefix such as `%wZ` or `%hZ` rather than `%Z` due to compatibility issues between CRTs. See the [format specification documentation](../c-runtime-library/format-specification-syntax-printf-and-wprintf-functions) for more details on compatibility.
To fix this warning, determine if the format specifier or the argument matches the intended behavior and modify the other to match. When modifying the format specifier for a counted string, it is recommended to explicitly use the size prefix such as `%wZ` or `%hZ` rather than `%Z` due to compatibility issues between CRTs. See the [format specification documentation](../c-runtime-library/format-specification-syntax-printf-and-wprintf-functions.md) for more details on compatibility.

Code analysis name: `MISSING_COUNTED_STRING_ARGUMENT_TO_FORMAT_FUNCTION`

Expand Down Expand Up @@ -43,4 +43,4 @@ int PrintDiagnostic(UNICODE_STRING u)
[sprintf_s, _sprintf_s_l, swprintf_s, _swprintf_s_l](../c-runtime-library/reference/sprintf-s-sprintf-s-l-swprintf-s-swprintf-s-l.md)\
[UNICODE_STRING](/windows/win32/api/ntdef/ns-ntdef-_unicode_string.md)\
[ANSI_STRING/_STRING](/windows/win32/api/ntdef/ns-ntdef-string.md)\
[C4313](../error-messages/compiler-warnings/C4313.md)
[C4313](../error-messages/compiler-warnings/compiler-warning-level-1-c4313.md)
2 changes: 1 addition & 1 deletion docs/code-quality/c6066.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ This warning is typically reported because an integer has been used for a `%p` f
[Format specification syntax: printf and wprintf functions](../c-runtime-library/format-specification-syntax-printf-and-wprintf-functions.md)\
[`sprintf_s`, `_sprintf_s_l`, `swprintf_s`, `_swprintf_s_l`](../c-runtime-library/reference/sprintf-s-sprintf-s-l-swprintf-s-swprintf-s-l.md)\
[`scanf_s`, `_scanf_s_l`, `wscanf_s`, `_wscanf_s_l`](../c-runtime-library/reference/scanf-s-scanf-s-l-wscanf-s-wscanf-s-l.md)\
[C4313](../error-messages/compiler-warnings/C4313.md)\
[C4313](../error-messages/compiler-warnings/compiler-warning-level-1-c4313.md)\
[C4477](../error-messages/compiler-warnings/C4477.md)
2 changes: 1 addition & 1 deletion docs/code-quality/c6067.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ void f_safe()
[sprintf\_s, \_sprintf\_s\_l, swprintf\_s, \_swprintf\_s\_l](../c-runtime-library/reference/sprintf-s-sprintf-s-l-swprintf-s-swprintf-s-l.md)\
[printf, \_printf\_l, wprintf, \_wprintf\_l](../c-runtime-library/reference/printf-printf-l-wprintf-wprintf-l.md)\
[scanf\_s, \_scanf\_s\_l, wscanf\_s, \_wscanf\_s\_l](../c-runtime-library/reference/scanf-s-scanf-s-l-wscanf-s-wscanf-s-l.md)\
[C4313](../error-messages/compiler-warnings/C4313.md)\
[C4313](../error-messages/compiler-warnings/compiler-warning-level-1-c4313.md)\
[C4477](../error-messages/compiler-warnings/C4477.md)
2 changes: 1 addition & 1 deletion docs/code-quality/c6271.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ void f()
[Format specification syntax: printf and wprintf functions](../c-runtime-library/format-specification-syntax-printf-and-wprintf-functions.md)\
[`sprintf`, `_sprintf_l`, `swprintf`, `_swprintf_l`, `__swprintf_l`](../c-runtime-library/reference/sprintf-sprintf-l-swprintf-swprintf-l-swprintf-l.md)\
[`sprintf_s`, `_sprintf_s_l`, `swprintf_s`, `_swprintf_s_l`](../c-runtime-library/reference/sprintf-s-sprintf-s-l-swprintf-s-swprintf-s-l.md)\
[C4474](../error-messages/compiler-warnings/C4474.md)
[C4474](../error-messages/compiler-warnings/compiler-warnings-c4400-through-c4599.md)
2 changes: 1 addition & 1 deletion docs/code-quality/c6274.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ void f(char str[])
[Format specification syntax: printf and wprintf functions](../c-runtime-library/format-specification-syntax-printf-and-wprintf-functions.md)\
[`sprintf, _sprintf_l, swprintf, _swprintf_l, __swprintf_l`](../c-runtime-library/reference/sprintf-sprintf-l-swprintf-swprintf-l-swprintf-l.md)\
[C4477](../error-messages/compiler-warnings/C4477.md)\
[C4313](../error-messages/compiler-warnings/C4474.md)
[C4313](../error-messages/compiler-warnings/C4313.md)
2 changes: 1 addition & 1 deletion docs/code-quality/c6284.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ void f()
[static_cast Operator](../cpp/static-cast-operator.md)\
[sprintf_s, _sprintf_s_l, swprintf_s, _swprintf_s_l](../c-runtime-library/reference/sprintf-s-sprintf-s-l-swprintf-s-swprintf-s-l.md)\
[C4477](../error-messages/compiler-warnings/C4477.md)\
[C4840](../error-messages/compiler-warnings/C4840.md)
[C4840](../error-messages/compiler-warnings/compiler-warning-level-4-c4840.md)