Skip to content

Commit 917a020

Browse files
author
Colin Robertson
committed
Address 1850 part 1
1 parent c7ac1c2 commit 917a020

File tree

9 files changed

+14
-13
lines changed

9 files changed

+14
-13
lines changed

docs/build/reference/zc-inline-remove-unreferenced-comdat.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void Example::normal_call() {
5959
// Compile by using: cl /W4 /EHsc /O2 zcinline.cpp example.cpp
6060
#include "example.h"
6161

62-
void main() {
62+
int main() {
6363
Example example;
6464
example.inline_call(); // normal call when definition unavailable
6565
}
@@ -101,7 +101,7 @@ void Example2::normal_call() {
101101
// Compile by using: cl /W4 /EHsc /O2 zcinline2.cpp example2.cpp
102102
#include "example2.h"
103103

104-
void main() {
104+
int main() {
105105
Example2 example2;
106106
example2.inline_call(); // normal call when definition unavailable
107107
}

docs/build/reference/zc-referencebinding-enforce-reference-binding-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ S g() {
3535
return S{};
3636
}
3737

38-
void main() {
38+
int main() {
3939
S& s = g(); // warning C4239 at /W4
4040
const S& cs = g(); // okay, bound to const ref
4141
f(g()); // Extension: error C2664 only if /Zc:referenceBinding

docs/build/walkthrough-compiling-a-native-cpp-program-on-the-command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Before you can build a C or C++ program on the command line, you must verify tha
6868
```cpp
6969
#include <iostream>
7070
using namespace std;
71-
void main()
71+
int main()
7272
{
7373
cout << "Hello, world, from Visual C++!" << endl;
7474
}

docs/c-runtime-library/reference/wcsrtombs-s.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ The **wcsrtombs_s** function is multithread safe as long as no function in the c
114114

115115
#define MB_BUFFER_SIZE 100
116116

117-
void main()
117+
int main()
118118
{
119119
const wchar_t wcString[] =
120120
{L"Every good boy does fine."};

docs/cpp/attributes.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Attributes represent a standardized alternative to vendor-specific extensions su
5757
- `[[gsl::suppress(rules)]]` This Microsoft-specific attribute is used for suppressing warnings from checkers that enforce [Guidelines Support Library (GSL)](https://github.com/Microsoft/GSL) rules in code. For example, consider this code snippet:
5858
5959
```cpp
60-
void main()
60+
int main()
6161
{
6262
int arr[10]; // GSL warning 26494 will be fired
6363
int* p = arr; // GSL warning 26485 will be fired
@@ -77,4 +77,5 @@ Attributes represent a standardized alternative to vendor-specific extensions su
7777
7878
- 26481 (Bounds Rule 1: Don't use pointer arithmetic. Use span instead.)
7979
80-
The first two warnings fire when you compile this code with the CppCoreCheck code analysis tool installed and activated. But the third warning doesn't fire because of the attribute. You can suppress the entire bounds profile by writing [[gsl::suppress(bounds)]] without including a specific rule number. The C++ Core Guidelines are designed to help you write better and safer code. The suppress attribute makes it easy to turn off the warnings when they are not wanted.
80+
The first two warnings fire when you compile this code with the CppCoreCheck code analysis tool installed and activated. But the third warning doesn't fire because of the attribute. You can suppress the entire bounds profile by writing [[gsl::suppress(bounds)]] without including a specific rule number. The C++ Core Guidelines are designed to help you write better and safer code. The suppress attribute makes it easy to turn off the warnings when they are not wanted.
81+

docs/cpp/import-export-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Non-exported names are not visible to code that imports the module:
4848

4949
import module ModuleA;
5050

51-
void main() {
51+
int main() {
5252
Bar::f(); // OK
5353
Bar::d(); // OK
5454
Bar::internal_f(); // Ill-formed: error C2065: 'internal_f': undeclared identifier

docs/error-messages/compiler-errors-1/compiler-error-c2346.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct S
3737
virtual __clrcall ~S() { }
3838
};
3939

40-
void main()
40+
int main()
4141
{
4242
S s;
4343
}

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4789.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ The following sample also generates C4789.
7070
// processor: x86
7171
short G;
7272

73-
void main()
73+
int main()
7474
{
7575
int * p = (int *)&G;
7676
*p = 3; // C4789 - writes an int through a pointer to short
7777
}
78-
```
78+
```

docs/error-messages/compiler-warnings/compiler-warning-level-3-c4373.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct Derived : Base
3737
}
3838
};
3939

40-
void main()
40+
int main()
4141
{
4242
Derived d;
4343
Base* p = &d;
@@ -47,4 +47,4 @@ void main()
4747
4848
```Output
4949
derived
50-
```
50+
```

0 commit comments

Comments
 (0)