Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
Compiler
C++
Front End
access
Bitfields
Destructors
Diagnostics
Exception Handling
Extensions
Initialization
Inline Assembly
Invocation
Language
Mangling Scheme
Namespaces
Object Generation
Overloading
Pragmas
Pre-Compiled Headers
Preprocessor
Refactoring
RTTI
Templates
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/Compiler/C++/Front End/Diagnostics
[ Add a report in this area ]
Report #:
47944
Status:
Open
Bad warning on casted long long (__int64)
Project:
C++Builder
Build #:
11.0.2709.7126
Version:
11.0
Submitted By:
Endre Simay
Report Type:
Minor failure / Design problem
Date Reported:
6/22/2007 7:03:54 AM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All versions
Internal Tracking #:
251661
Resolution:
Need More Info
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
5.00 out of 5
Total Votes:
None
Description
The lines like:
__int64 mymin = __int64(9223372036854775807);
__int64 mymin = (__int64)9223372036854775807;
__int64 mymin = (long long)9223372036854775807;
result a warning about integer overflow.
Steps to Reproduce:
insert any of the lines :
__int64 mymin = __int64(9223372036854775807);
__int64 mymin = (__int64)9223372036854775807;
__int64 mymin = (long long)9223372036854775807;
press ctrl+F9.
result a warning about potential overflow, while this warning probably not needed. Just because 9223372036854775807 is a valid value for __int64, and the cast probably could avoid the overflow, too.
Workarounds
None
Attachment
None
Comments
Alisdair Meredith at 9/2/2010 6:28:01 AM
-
The warning look correct as the literals are 'int' literals. If you want to parse as 64-bit literals, you need to make them 'long long' literals with the LL suffix.
Tomohiro Takahashi at 9/2/2010 10:10:44 PM
-
Thanks for the information, Alisdair-san.
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us