2390 – Missing warning on conversion from int to char

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2390 - Missing warning on conversion from int to char
Summary: Missing warning on conversion from int to char
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2008年10月03日 23:14 UTC by Nick Sabalausky
Modified: 2014年03月01日 00:36 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Nick Sabalausky 2008年10月03日 23:14:11 UTC
The warning "implicit conversion of expression expr of type 'type' to 'type' can cause loss of data" is not issued when converting an int to a char.
void main()
{
 int myInt = 999;
 byte b = myInt; // Warning issued
}
void main()
{
 int myInt = 999;
 char c = myInt; // No warning issued
}
Comment 1 Walter Bright 2008年10月20日 22:20:44 UTC
Fixed dmd 1.036 and 2.020


AltStyle によって変換されたページ (->オリジナル) /