Skip to content

Commit 44e61b1

Browse files
Merge pull request #5002 from MicrosoftDocs/main638472439838109198sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents df602a6 + 2cfa2e1 commit 44e61b1

File tree

4 files changed

+42
-13
lines changed

4 files changed

+42
-13
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4165"
3-
title: "Compiler Warning (level 1) C4165"
2+
description: "Learn more about: Compiler Warning (level 3, off) C4165"
3+
title: "Compiler Warning (level 3, off) C4165"
44
ms.date: "11/04/2016"
55
f1_keywords: ["C4165"]
66
helpviewer_keywords: ["C4165"]
7-
ms.assetid: f5bed515-2290-4f88-8dab-b45d95fe26ef
87
---
9-
# Compiler Warning (level 1) C4165
8+
# Compiler Warning (level 3, off) C4165
109

11-
'HRESULT' is being converted to 'bool'; are you sure this is what you want?
10+
'`HRESULT`' is being converted to '`bool`'; are you sure this is what you want?
1211

13-
When using an HRESULT in an [if](../../cpp/if-else-statement-cpp.md) statement, the HRESULT will be converted to a [bool](../../cpp/bool-cpp.md) unless you explicitly test for the variable as an HRESULT. This warning is off by default.
12+
When an `HRESULT` is used in an [`if`](../../cpp/if-else-statement-cpp.md) statement, the `HRESULT` is converted to a [`bool`](../../cpp/bool-cpp.md) unless you explicitly test for the variable as an `HRESULT`.
13+
14+
Warning C4165 is off by default. For more information, see [Compiler Warnings That Are Off By Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1415

1516
## Example
1617

17-
The following sample generates C4165
18+
The following sample generates C4165:
1819

1920
```cpp
2021
// C4165.cpp
21-
// compile with: /W1
22+
// compile with: /W3
2223
#include <windows.h>
23-
#pragma warning(1:4165)
24+
#pragma warning(3:4165)
2425

2526
extern HRESULT hr;
2627
int main() {

docs/error-messages/compiler-warnings/compiler-warnings-c4000-through-c4199.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The articles in this section of the documentation explain a subset of the warnin
1515

1616
|Warning|Message|
1717
|-------------|-------------|
18-
|Compiler warning C4000|UNKNOWN WARNING<br /><br /> Please choose the Technical Support command on the Visual C++<br /><br /> Help menu, or open the Technical Support help file for more information|
18+
|Compiler warning C4000|UNKNOWN WARNING<br/> Please choose the Technical Support command on the Visual C++<br/> Help menu, or open the Technical Support help file for more information|
1919
|[Compiler warning (level 4) C4001](../../error-messages/compiler-warnings/compiler-warning-level-4-c4001.md)|nonstandard extension 'single line comment' was used|
2020
|[Compiler warning (level 1) C4002](compiler-warning-level-1-c4002.md)|too many actual parameters for macro 'identifier'|
2121
|[Compiler warning (level 1) C4003](../../error-messages/compiler-warnings/compiler-warning-level-1-c4003.md)|not enough actual parameters for macro 'identifier'|
@@ -70,7 +70,7 @@ The articles in this section of the documentation explain a subset of the warnin
7070
|[Compiler warning (level 3) C4073](../../error-messages/compiler-warnings/compiler-warning-level-3-c4073.md)|initializers put in library initialization area|
7171
|[Compiler warning (level 1) C4074](../../error-messages/compiler-warnings/compiler-warning-level-1-c4074.md)|initializers put in compiler reserved initialization area|
7272
|[Compiler warning (level 1) C4075](compiler-warning-level-1-c4075.md)|initializers put in unrecognized initialization area|
73-
|[Compiler warning (level 1) C4076](compiler-warning-level-1-c4076.md)|'type_modifier': can not be used with type 'typename'|
73+
|[Compiler warning (level 1) C4076](compiler-warning-level-1-c4076.md)|'type_modifier': can't be used with type 'typename'|
7474
|[Compiler warning (level 1) C4077](compiler-warning-level-1-c4077.md)|unknown check_stack option|
7575
|[Compiler warning (level 1) C4079](../../error-messages/compiler-warnings/compiler-warning-level-1-c4079.md)|unexpected token 'token'|
7676
|[Compiler warning (level 1) C4080](compiler-warning-level-1-c4080.md)|expected identifier for segment name; found 'symbol'|
@@ -135,7 +135,7 @@ The articles in this section of the documentation explain a subset of the warnin
135135
|[Compiler warning (level 1) C4162](../../error-messages/compiler-warnings/compiler-warning-level-1-c4162.md)|'identifier': no function with C linkage found|
136136
|[Compiler warning (level 1) C4163](compiler-warning-level-1-c4163.md)|'identifier': not available as an intrinsic function|
137137
|[Compiler warning (level 1) C4164](compiler-warning-level-1-c4164.md)|'function': intrinsic function not declared|
138-
|[Compiler warning (level 1) C4165](compiler-warning-level-1-c4165.md)|'HRESULT' is being converted to 'bool'; are you sure this is what you want?|
138+
|[Compiler warning (level 3, off) C4165](compiler-warning-level-1-c4165.md)|'HRESULT' is being converted to 'bool'; are you sure this is what you want?|
139139
|[Compiler warning (level 1) C4166](compiler-warning-level-1-c4166.md)|illegal calling convention for constructor/destructor|
140140
|[Compiler warning (level 1) C4167](compiler-warning-level-1-c4167.md)|'function': only available as an intrinsic function|
141141
|[Compiler warning (level 1) C4168](compiler-warning-level-1-c4168.md)|compiler limit: out of debugger types, delete program database 'database' and rebuild|

docs/error-messages/compiler-warnings/compiler-warnings-c4800-through-c4999.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The articles in this section of the documentation explain a subset of the warnin
1616
| Warning | Message |
1717
|--|--|
1818
| [Compiler warning (level 4, off) C4800](compiler-warning-level-3-c4800.md) | Implicit conversion from '*type*' to `bool`. Possible information loss |
19+
|Compiler warning C4801|Return by reference is not verifiable: *message*|
1920
| [Compiler warning (level 1) C4803](compiler-warning-level-1-c4803.md) | '*method*': the raise method has a different storage class from that of the event, '*event*' |
2021
| [Compiler warning (level 1) C4804](compiler-warning-level-1-c4804.md) | '*operation*': unsafe use of type '`bool`' in operation |
2122
| [Compiler warning (level 1) C4805](compiler-warning-level-1-c4805.md) | '*operation*': unsafe mix of type '*type1*' and type '*type2*' in operation |
@@ -27,6 +28,7 @@ The articles in this section of the documentation explain a subset of the warnin
2728
| [Compiler warning (level 1) C4811](compiler-warning-level-1-c4811.md) | value of `pragma conform(forScope, show)` == *value* |
2829
| [Compiler warning (level 1) C4812](compiler-warning-level-1-c4812.md) | obsolete declaration style: please use '*new_syntax*' instead |
2930
| [Compiler warning (level 1) C4813](compiler-warning-level-1-c4813.md) | '*function*': a friend function of a local class must have been previously declared |
31+
|Compiler warning (level 4) C4815|'*object name*': zero-sized array in stack object will have no elements (unless the object is an aggregate that has been aggregate initialized)|
3032
| [Compiler warning (level 4) C4816](compiler-warning-level-4-c4816.md) | '*param*': parameter has a zero-sized array which will be truncated (unless the object is passed by reference) |
3133
| [Compiler warning (level 1) C4817](compiler-warning-level-1-c4817.md) | '*member*': illegal use of '.' to access this member; compiler replaced with '->' |
3234
| [Compiler warning (level 1) C4819](compiler-warning-level-1-c4819.md) | The file contains a character that cannot be represented in the current code page (number). Save the file in Unicode format to prevent data loss |
@@ -36,6 +38,7 @@ The articles in this section of the documentation explain a subset of the warnin
3638
| [Compiler warning (level 3) C4823](compiler-warning-level-3-c4823.md) | '*function*': uses pinning pointers but unwind semantics are not enabled. Consider using `/EHa` |
3739
| Compiler warning (level 2, off) C4826 | Conversion from '*type1*' to '*type2*' is sign-extended. This may cause unexpected runtime behavior. |
3840
| Compiler warning (level 3) C4827 | A public '`ToString`' method with 0 parameters should be marked as `virtual` and `override` |
41+
|Compiler warning (level 1) C4828|The file contains a character starting at offset 0x*HexOffset* that is illegal in the current source character set (codepage *codepage*).|
3942
| [Compiler warning (level 1) C4829](compiler-warning-level-1-c4829.md) | Possibly incorrect parameters to function `main`. Consider '`int main(Platform::Array<Platform::String^>^ argv)`' |
4043
| [Compiler warning (level 1) C4834](c4834.md) | discarding return value of function with 'nodiscard' attribute |
4144
| [Compiler warning (level 1) C4835](compiler-warning-level-1-c4835.md) | '*variable*': the initializer for exported data will not be run until managed code is first executed in the host assembly |
@@ -51,20 +54,28 @@ The articles in this section of the documentation explain a subset of the warnin
5154
| Compiler warning (level 4) C4846 | '*value*' is not a valid argument for '`/d1initall`': command-line flag ignored |
5255
| Compiler warning (level 4) C4847 | '`__declspec(no_init_all)`' can only be applied to a function, a class type, or a local variable: ignored |
5356
| Compiler warning (level 1) C4848 | support for standard attribute '`no_unique_address`' in C++17 and earlier is a vendor extension |
57+
|Compiler warning (level 1) C4849|OpenMP '*clause*' clause ignored in '*directive*' directive|
5458
| Compiler warning (Level 1, error) C4854 | binding dereferenced null pointer to reference has undefined behavior |
5559
| Compiler warning (level 1, off) C4855 | implicit capture of '`this`' via '`[=]`' is deprecated in 'version' |
5660
| Compiler warning (level 4) C4856 | '*value*' is not a valid argument for '`/d1initAll:FillPattern`' (value must be between 0 and 255). Command-line flag ignored |
5761
| Compiler warning (level 1) C4857 | C++/CLI mode does not support C++ versions newer than C++17; setting language to `/std:c++17` |
62+
|Compiler warning (level 1) C4858|discarding return value: *function name*|
63+
|Compiler warning (level 4) C4859|'*value*' is not a valid argument for '`/presetWarn`': it must be a decimal value > 0. Command-line flag ignored|
64+
|Compiler warning (level 4) C4860|'*object name*': compiler zero initialized '*number*' bytes of storage|
65+
|Compiler warning (level 4) C4861|compiler zero initialized '*number*' bytes of storage|
5866
| [Compiler warning (level 4) C4866](c4866.md) | compiler may not enforce left-to-right evaluation order for call to *operator_name* |
5967
| [Compiler warning (level 1, error) C4867](compiler-warning-c4867.md) | '*function*': function call missing argument list; use '*call*' to create a pointer to member |
6068
| [Compiler warning (level 4) C4868](compiler-warning-c4868.md) | '*file*(*line_number*)' compiler may not enforce left-to-right evaluation order in braced initialization list |
69+
|Compiler warning (level 3) C4869|'`nodiscard`' may only be applied to classes, enumerations, and functions|
6170
| Compiler warning (level 2) C4872 | floating point division by zero detected when compiling the call graph for the `concurrency::parallel_for_each` at: '*location*' |
6271
| Compiler warning (level 1) C4880 | casting from 'const *type_1*' to '*type_2*': casting away constness from a pointer or reference may result in undefined behavior in an amp restricted function |
6372
| Compiler warning (level 4) C4881 | the constructor and/or the destructor will not be invoked for `tile_static` variable '*variable-name*' |
6473
| Compiler warning (level 1) C4882 | passing functors with non-const call operators to `concurrency::parallel_for_each` is deprecated |
74+
|Compiler warning C4883|'*function name*': function size suppresses optimizations|
6575
| [Compiler warning C4900](compiler-warning-level-1-c4900.md) | Il mismatch between '*tool1*' version '*version1*' and '*tool2*' version '*version2*' |
6676
| [Compiler warning (level 1, off) C4905](compiler-warning-level-1-c4905.md) | wide string literal cast to '`LPSTR`' |
6777
| [Compiler warning (level 1, off) C4906](compiler-warning-level-1-c4906.md) | string literal cast to '`LPWSTR`' |
78+
|Compiler warning (Error) C4907|multiple calling conventions cannot be specified; last given will be used|
6879
| [Compiler warning (level 1) C4910](compiler-warning-level-1-c4910.md) | '\<identifier>: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation |
6980
| [Compiler warning (level 1) C4912](compiler-warning-level-1-c4912.md) | '*attribute*': attribute has undefined behavior on a nested UDT |
7081
| [Compiler warning (level 4) C4913](compiler-warning-level-4-c4913.md) | user defined binary operator '`,`' exists but no overload could convert all operands, default built-in binary operator '`,`' used |
@@ -115,6 +126,8 @@ The articles in this section of the documentation explain a subset of the warnin
115126
| [Compiler warning (level 1, Error) C4972](compiler-warning-c4972.md) | Directly modifying or treating the result of an unbox operation as an lvalue is unverifiable |
116127
| Compiler warning (level 1) C4973 | '*symbol*': marked as deprecated |
117128
| Compiler warning (level 1) C4974 | '*symbol*': marked as deprecated |
129+
|Compiler warning (level 1) C4975|modopt '[*modifier*]' was ignored for formal parameter '*parameter*'|
130+
|Compiler warning (level 1) C4976|invalid value '*value*' for '`/W`'; assuming '1'|
118131
| Compiler warning (level 3) C4981 | Warbird: function '*function*' marked as __forceinline not inlined because it contains exception semantics |
119132
| Compiler warning (level 3) C4983 | '/analyze:sarif:hashname' ignored because the argument to '/analyze:log' is a single file rather than a directory |
120133
| [Compiler warning C4984](compiler-warning-c4984.md) | '`if constexpr`' is a C++17 language extension |
@@ -184,6 +197,8 @@ The articles in this section of the documentation explain a subset of the warnin
184197
| Compiler warning (level 1) C5106 | macro redefined with different parameter names |
185198
| Compiler warning (level 1) C5107 | missing terminating '*char*' character |
186199
| Compiler warning (level 1) C5108 | `__VA_OPT__` is reserved for use in variadic macros |
200+
|Compiler warning (level 1) C5109|`__VA_OPT__` use in macro requires '`/Zc:preprocessor`'|
201+
|Compiler warning (level 4, off) C5110|`__VA_OPT__` is an extension prior to C++20 or C23|
187202
| Compiler warning (level 1) C5200 | feature 'feature-name' requires compiler flag 'option-name' |
188203
| Compiler warning (level 1) C5201 | a module declaration can appear only at the start of a translation unit unless a global module fragment is used |
189204
| Compiler warning (level 1) C5202 | a global module fragment can only contain preprocessor directives |
@@ -248,11 +263,24 @@ The articles in this section of the documentation explain a subset of the warnin
248263
| [Compiler warning (level 1, error, off) C5262](c5262.md) | implicit fall-through occurs here; are you missing a break statement? Use `[[fallthrough]]` when a `break` statement is intentionally omitted between cases |
249264
| Compiler warning (level 4, off) C5263 | calling '`std::move`' on a temporary object prevents copy elision |
250265
| Compiler warning (level 4, off) C5264 | '*variable-name*': 'const' variable is not used |
266+
|Compiler warning (level 1) C5265|cannot open search path '*path*'|
251267
| [Compiler warning (level 4, off) C5266](compiler-warning-level-4-c5266.md) | 'const' qualifier on return type has no effect |
252268
| [Compiler warning C5267](c5267.md) | definition of implicit copy constructor/assignment operator for '*type*' is deprecated because it has a user-provided assignment operator/copy constructor |
269+
|Compiler warning (level 1) C5268|Failed to allocate memory at fixed address 0x*address*. Use `/Yb` to specify a specific address base if bit-identical .pch files are required.|
270+
|Compiler warning (level 1) C5269|Failed to allocate PCH memory at fixed address 0x*address*. Use `/Ym` to specify a specific address base if bit-identical .pch files are required.|
271+
|Compiler warning (level 3) C5270|'*value*' is not allowed for option '*switch name*'; allowed values are: *value list*|
272+
|Compiler warning (level 4) C5271|previously imported assembly '*assembly1*' has the same name as assembly '*assembly2*' being imported. Is this intentional?|
273+
|Compiler warning (level 1) C5272|throwing an object of non-copyable type '*type*' is non-standard. If a copy is needed at runtime it will be made as if by `memcpy`.|
274+
|Compiler warning (level 1) C5273|behavior change: `_Alignas` on anonymous type no longer ignored (promoted members will align)|
275+
|Compiler warning (level 1) C5274|behavior change: `_Alignas` no longer applies to the type '*type*' (only applies to declared data objects)|
276+
|Compiler warning (Error) C5275|facade assembly '*name*' being imported under '`/clr`'; missing option '`/clr:netcore`'?|
253277
| Compiler warning (level 1, error) C5300 | '#pragma omp atomic': left operand of '*operator*' must match left hand side of assignment-expression |
254278
| [Compiler warning (level 1) C5301](c5301-c5302.md) | '#pragma omp for': '*loop-index*' increases while loop condition uses '*comparison*'; non-terminating loop? |
255279
| [Compiler warning (level 1) C5302](c5301-c5302.md) | '#pragma omp for': '*loop-index*' decreases while loop condition uses '*comparison*'; non-terminating loop? |
280+
|Compiler warning (level 1) C5303|function marked with `[[msvc::intrinsic]]` did not result in a no-op cast|
281+
|Compiler warning (level 1) C5304|a declaration designated by the using-declaration '*name1*' exported from this module has internal linkage and using such a name outside the module is ill-formed; consider declaring '*name2*' '`inline`' to use it outside of this module|
282+
|Compiler warning (level 1) C5305|'*name*': an explicit instantiation declaration that follows an explicit instantiation definition is ignored|
283+
256284

257285
## See also
258286

docs/error-messages/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3403,7 +3403,7 @@ items:
34033403
href: compiler-warnings/compiler-warning-level-1-c4163.md
34043404
- name: Compiler warning (level 1) C4164
34053405
href: compiler-warnings/compiler-warning-level-1-c4164.md
3406-
- name: Compiler warning (level 1) C4165
3406+
- name: Compiler warning (level 3, off) C4165
34073407
href: compiler-warnings/compiler-warning-level-1-c4165.md
34083408
- name: Compiler warning (level 1) C4166
34093409
href: compiler-warnings/compiler-warning-level-1-c4166.md

0 commit comments

Comments
 (0)