PRC9108003: C 5.1 _arc() May Generate R6003 Error

ID Number: Q75326

5.10

MS-DOS

buglist5.10 fixlist6.00

Summary:

SYMPTOMS

In the Microsoft C Compiler version 5.1 and the Microsoft QuickC

Compiler versions 1.0, 1.01, 2.0, and 2.01, the function _arc() may

generate the following error:

run-time error R6003

-integer divide by 0

CAUSE

The _arc() function takes the following parameters:

_arc( SHORT x1, SHORT y1, SHORT x2, SHORT y2,

SHORT x3, SHORT y3, SHORT x4, SHORT y4 );

The function does not work properly if the following statements

are not true:

|x1| + |x2| <= 32767

|y1| + |y2| <= 32767

STATUS

Microsoft has confirmed this to be a problem in C version 5.1 and in

QuickC versions 1.0, 1.01, 2.0, and 2.01 (buglist1.00, buglist1.01,

buglist2.00, buglist2.01). This problem was corrected in C version

6.0 and in QuickC version 2.5 (fixlist2.50).

More Information:

The following program generates the R6003 error message.

Sample Code

-----------

/* Compile options needed: none

*/

#include <stdio.h>

#include <conio.h>

#include <graph.h>

void main(void);

short ret;

void main( )

{

_setvideomode ( _VRES16COLOR );

ret = _arc ( -20000, -120, 12768, 4480, 342, 346, 205, 315 );

printf( "ret = %d\n", ret );

getch();

_setvideomode ( _DEFAULTMODE );

}

Additional reference words: 1.00 2.00 2.50 5.10 6.00