LONG INTEGER Overflow Is Not Detected in EXE (35885)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1

This article was previously published under Q35885

SYMPTOMS

The program below, when run in the QB.EXE or QBX.EXE editor, correctly generates an "Overflow" message. However, the EXE program incorrectly prints a -2 (even when compiled with the /D (debug) option).

STATUS

Microsoft has confirmed this to be a bug in QuickBasic versions 4.00, 4.00b, and 4.50; in Microsoft Basic Compiler versions 6.00 and 6.00b (buglist6.00, buglist6.00b) for MS-DOS and MS OS/2; and in Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 (buglist7.00, buglist7.10) for MS-DOS and MS OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following is a code example:
   a& = 2147483647     ' Largest positive long integer
   b& = 2
   x& = a& * b&
   PRINT x&            ' EXE version prints a -2
				

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB35885