digitalmars.D.bugs - [Issue 230] New: long.min cannot be parsed
- d-bugmail puremagic.com (18/18) Jun 28 2006 http://d.puremagic.com/issues/show_bug.cgi?id=230
- d-bugmail puremagic.com (9/9) Jun 28 2006 http://d.puremagic.com/issues/show_bug.cgi?id=230
- BCS (1/2) Jun 28 2006 edit: OTOH: should it be /allowed/?
- d-bugmail puremagic.com (5/5) Jun 28 2006 http://d.puremagic.com/issues/show_bug.cgi?id=230
- d-bugmail puremagic.com (10/10) Jul 08 2006 http://d.puremagic.com/issues/show_bug.cgi?id=230
http://d.puremagic.com/issues/show_bug.cgi?id=230
Summary: long.min cannot be parsed
Product: D
Version: 0.161
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: benoit tionex.de
void main(){
assert( +9223372036854775807L == long.max );
assert( -9223372036854775807L == long.min );
assert( -9223372036854775808L == long.min ); // signed integer overflow
}
--
Jun 28 2006
http://d.puremagic.com/issues/show_bug.cgi?id=230 Quoting the speck (lex.html) Decimal Literal, L Suffix Type 0L .. 9223372036854775807L long -(9223372036854775808L) is invalid b/c it is parsed as "- intLiteral" Bug is not in DMD. OTOH: should it be? --
Jun 28 2006
http://d.puremagic.com/issues/show_bug.cgi?id=230 Seems to be according to the spec. But for me it is not logic that I can write 0x8000_0000_0000_0000L but not -9223372036854775808L. --
Jun 28 2006
http://d.puremagic.com/issues/show_bug.cgi?id=230
bugzilla digitalmars.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
The compiler is behaving correctly. The - is applied after the numeric literal
is processed, and 9223372036854775808L is out of range.
--
Jul 08 2006









BCS <BCS pathlink.com> 