Skip to content

Commit a1c5af6

Browse files
authored
Replace term "sample" with "example" for warning references in range [C6251, C6310]
1 parent b506367 commit a1c5af6

File tree

12 files changed

+17
-17
lines changed

12 files changed

+17
-17
lines changed

docs/code-quality/c6259.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Code analysis name: `DEADCODEINBITORLIMITEDSWITCH`
1818

1919
## Example
2020

21-
The following sample code generates this warning because the 'switch' expression `(rand() & 3)` can't evaluate to case label (`case 4`):
21+
The following example code generates this warning because the 'switch' expression `(rand() & 3)` can't evaluate to case label (`case 4`):
2222

2323
```cpp
2424
#include <stdlib.h>

docs/code-quality/c6271.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Code analysis name: `EXTRA_ARGUMENT_TO_FORMAT_FUNCTION`
1717

1818
## Example
1919

20-
The following sample code generates this warning:
20+
The following example code generates this warning:
2121

2222
```cpp
2323
#include <stdio.h>
@@ -43,7 +43,7 @@ void f()
4343
}
4444
```
4545

46-
The following sample code calls the safe string manipulation function, `sprintf_s`, to correct this warning:
46+
The following example code calls the safe string manipulation function, `sprintf_s`, to correct this warning:
4747

4848
```cpp
4949
#include <stdio.h>

docs/code-quality/c6277.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Code analysis name: `CREATEPROCESS_ESCAPE`
2020

2121
## Example
2222

23-
The following sample code generates warning C6277. The warning is caused by the NULL application name and from the executable path name having a space. Due to how the function parses spaces, there's a risk that a different executable could be run. For more information, see [`CreateProcessA`](/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa).
23+
The following example code generates warning C6277. The warning is caused by the NULL application name and from the executable path name having a space. Due to how the function parses spaces, there's a risk that a different executable could be run. For more information, see [`CreateProcessA`](/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa).
2424

2525
```cpp
2626
#include <windows.h>

docs/code-quality/c6278.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Code analysis name: `ARRAY_NEW_DELETE_MISMATCH`
3030

3131
## Example
3232

33-
The following sample code generates warning C6278:
33+
The following example code generates warning C6278:
3434

3535
```cpp
3636
class A
@@ -46,7 +46,7 @@ void f( )
4646
}
4747
```
4848
49-
To correct this warning, use the following sample code:
49+
To correct this warning, use the following example code:
5050
5151
```cpp
5252
void f( )

docs/code-quality/c6280.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Code analysis name: `MEMORY_ALLOCATION_MISMATCH`
2222

2323
## Example
2424

25-
The following sample code generates this warning. `pInt` is allocated using `calloc` but is freed using the mismatched function `delete`:
25+
The following example code generates this warning. `pInt` is allocated using `calloc` but is freed using the mismatched function `delete`:
2626

2727
```cpp
2828
// C6280a_warning.cpp

docs/code-quality/c6290.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void f(int x, int y)
4646
}
4747
```
4848
49-
To correct this warning, use the following sample code:
49+
To correct this warning, use the following example code:
5050
5151
```cpp
5252
void f(int x, int y)

docs/code-quality/c6293.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Code analysis name: `LOOP_INDEX_GOES_NEGATIVE`
2020

2121
## Example
2222

23-
The following sample code generates this warning:
23+
The following example code generates this warning:
2424

2525
```cpp
2626
void f( )

docs/code-quality/c6294.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Code analysis name: `LOOP_BODY_NEVER_EXECUTED`
1818

1919
## Example
2020

21-
The following sample code generates this warning because MAX_VALUE is 0:
21+
The following example code generates this warning because MAX_VALUE is 0:
2222

2323
```cpp
2424
#define MAX_VALUE 0
@@ -32,7 +32,7 @@ void f()
3232
}
3333
```
3434
35-
The following sample code corrects this warning by changing the value of MAX_VALUE to 25
35+
The following example code corrects this warning by changing the value of MAX_VALUE to 25
3636
3737
```cpp
3838
#define MAX_VALUE 25

docs/code-quality/c6298.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Code analysis name: `CONST_STRING_TO_WRITABLE_STRING`
2020

2121
## Example
2222

23-
The following sample code generates this warning:
23+
The following example code generates this warning:
2424

2525
```cpp
2626
#include <windows.h>
@@ -58,7 +58,7 @@ void f()
5858
}
5959
```
6060

61-
To correct this warning, use the following sample code:
61+
To correct this warning, use the following example code:
6262

6363
```cpp
6464
#include <windows.h>

docs/code-quality/c6302.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void f()
2727
}
2828
```
2929

30-
The following sample code remediates this issue by using `%hs` to specify a single-byte character string. Alternatively it could have switched to `%S`, which is a narrow string when used with `wprintf` like functions. See [Format specification syntax: `printf` and `wprintf` functions](../c-runtime-library/format-specification-syntax-printf-and-wprintf-functions.md#type-field-characters) for more options.
30+
The following example code remediates this issue by using `%hs` to specify a single-byte character string. Alternatively it could have switched to `%S`, which is a narrow string when used with `wprintf` like functions. See [Format specification syntax: `printf` and `wprintf` functions](../c-runtime-library/format-specification-syntax-printf-and-wprintf-functions.md#type-field-characters) for more options.
3131

3232
```cpp
3333
void f()

0 commit comments

Comments
 (0)