Skip to content

Commit 022b681

Browse files
authored
Prefer standard main function signatures
1 parent 41d001a commit 022b681

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

docs/c-runtime-library/find-memory-leaks-using-the-crt-library.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Find memory leaks with the CRT library
33
description: Learn how the C/C++ debugger and C Run-time Library (CRT) can help find memory leaks. The techniques include memory-leak reports and comparing memory snapshots.
44
ms.date: 02/03/2023
5-
helpviewer_keywords:
5+
helpviewer_keywords:
66
- breakpoints, on memory allocation
77
- _CrtMemState
88
- _CrtMemCheckpoint
@@ -165,7 +165,7 @@ struct Pod {
165165
int x;
166166
};
167167

168-
void main() {
168+
int main() {
169169
Pod* pPod = DBG_NEW Pod;
170170
pPod = DBG_NEW Pod; // Oops, leaked the original pPod!
171171
delete pPod;

docs/code-quality/c6387.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Warning C6387"
32
title: Warning C6387
3+
description: "Learn more about: Warning C6387"
44
ms.date: 11/04/2016
55
f1_keywords: ["C6387", "INVALID_PARAM_VALUE_1", "__WARNING_INVALID_PARAM_VALUE_1"]
66
helpviewer_keywords: ["C6387"]
7-
ms.assetid: 3ea2fc4d-ffc3-4c3c-bfae-d42aa56235d8
87
---
98
# Warning C6387
109

@@ -27,7 +26,7 @@ _Post_ _Null_ char * g();
2726

2827
void f(_In_ char *pch);
2928

30-
void main()
29+
int main()
3130
{
3231
char *pCh = g();
3332
f(pCh); // Warning C6387
@@ -43,7 +42,7 @@ _Post_ _Notnull_ char * g();
4342
4443
void f(_In_ char *pch);
4544
46-
void main()
45+
int main()
4746
{
4847
char *pCh = g();
4948
f(pCh);

docs/sanitizers/asan-continue-on-error.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Create the example:
196196

197197
char buffer[10] = {0,1,2,3,4,5,6,7,8,9};
198198

199-
void main()
199+
int main()
200200
{
201201
char* inverted_buf= func(buffer, 10);
202202
}
@@ -317,7 +317,7 @@ int foo_redundant(unsigned long arg_var)
317317
return ret;
318318
}
319319

320-
void main()
320+
int main()
321321
{
322322
int cnt = 0;
323323

@@ -351,4 +351,4 @@ With the new ASAN runtime, no extra binaries need to be deployed with your app.
351351
[Example memory safety errors](asan.md#error-types)\
352352
[-Zi compiler flag](../build/reference/z7-zi-zi-debug-information-format.md#zi)\
353353
[-fsanitize=address compiler flag](../build/reference/fsanitize.md)\
354-
[Top 25 most dangerous software weaknesses](https://cwe.mitre.org/top25/archive/2021/2021_cwe_top25.html)
354+
[Top 25 most dangerous software weaknesses](https://cwe.mitre.org/top25/archive/2021/2021_cwe_top25.html)

docs/sanitizers/error-stack-use-after-scope.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ devenv /debugexe example2.exe
8080
struct IntHolder {
8181
explicit IntHolder(int* val = 0) : val_(val) { }
8282
~IntHolder() {
83-
printf("Value: %d\n", *val_); // Bom!
83+
printf("Value: %d\n", *val_); // Boom!
8484
}
8585
void set(int* val) { val_ = val; }
8686
int* get() { return val_; }
@@ -138,7 +138,7 @@ void temp_from_conversion() {
138138
a.print();
139139
}
140140

141-
void main() {
141+
int main() {
142142
explicit_temp();
143143
temp_from_conversion();
144144
}

docs/standard-library/span-functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: <span> functions"
32
title: "<span> functions"
3+
description: "Learn more about: <span> functions"
44
ms.date: "05/28/2020"
55
f1_keywords: ["span/std::span::as_bytes", "span/std::as_writable_bytes"]
66
helpviewer_keywords: ["std::span [C++], as_writable_bytes", "std::as_bytes [C++]"]
@@ -47,7 +47,7 @@ A `span<const byte, S>` to the first item stored in the span where `S` is `{rein
4747
4848
using namespace std;
4949
50-
void main()
50+
int main()
5151
{
5252
int a[] = { 0,1,2 };
5353
span <int> mySpan(a);
@@ -87,7 +87,7 @@ A `span<byte, S>` to the first item stored in the span where `S` is `{reinterpre
8787
8888
using namespace std;
8989
90-
void main()
90+
int main()
9191
{
9292
int a[] = { 0,1,2 };
9393
span <int> mySpan(a);

0 commit comments

Comments
 (0)