Skip to content

Repo sync for protected branch #4773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
description: "Learn more about: Compiler Warning (level 3) C4310"
description: "Learn more about: Compiler Warning (level 4) C4310"
title: "Compiler Warning (level 3) C4310"
ms.date: "11/04/2016"
ms.date: 10/17/2023
f1_keywords: ["C4310"]
helpviewer_keywords: ["C4310"]
ms.assetid: cba3eca1-f1ed-499c-9243-337446bdbdd8
---
# Compiler Warning (level 3) C4310
# Compiler Warning (level 4) C4310

cast truncates constant value

Expand All @@ -15,7 +14,8 @@ A constant value is cast to a smaller type. The compiler performs the cast, whic
```cpp
// C4310.cpp
// compile with: /W4
int main() {
int main()
{
long int a;
a = (char) 128; // C4310, use value 0-127 to resolve
}
Expand Down
2 changes: 1 addition & 1 deletion docs/error-messages/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3606,7 +3606,7 @@ items:
href: compiler-warnings/compiler-warning-level-2-c4308.md
- name: Compiler warning (level 2) C4309
href: compiler-warnings/compiler-warning-level-2-c4309.md
- name: Compiler warning (level 3) C4310
- name: Compiler warning (level 4) C4310
href: compiler-warnings/compiler-warning-level-3-c4310.md
- name: Compiler warning (level 1) C4311
href: compiler-warnings/compiler-warning-level-1-c4311.md
Expand Down