Bug 37526 - compiler message: ... is out of range
Summary: compiler message: ... is out of range
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 95
: P3 normal (vote)
Target Milestone: 3.0 M1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-12 18:02 EDT by utybus CLA
Modified: 2003-06-02 06:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description utybus CLA 2003-05-12 18:02:52 EDT
!! compare uses values from int instead from long !!

  example:

  long  MONTHS  = 2147483648;

  -> ... is out of range

  long  MONTHS  = 2147483647;

  -> okay

  2147483647 is the greatest positive number from signed int, not signed long !
Comment 1 utybus CLA 2003-05-12 21:07:44 EDT
not a bug:

An integer literal is of type long if it is suffixed with an ASCII letter L or l 
(ell); otherwise it is of type int.

Comment 2 Philipe Mulet CLA 2003-05-13 05:11:49 EDT
Closing as invalid
Comment 3 Philipe Mulet CLA 2003-05-13 05:52:13 EDT
Improved error message to indicate the literal type.