PRB:_polygon_w Doesn't Draw Polygon If Data First in Segment

ID Number: Q70139

6.00 6.00a 6.00ax

MS-DOS

buglist6.00 buglist6.00a buglist6.00ax fixlist7.00

Summary:

SYMPTOMS

In Microsoft C versions 5.1, 6.0, 6.0a, and 6.0ax, the _polygon_w()

function does not display a polygon if the array that defines the

polygon is the first data in its data segment. An array will be

first in its segment if it is declared far before any other far

variables are declared. The sample program below illustrates this

problem.

RESOLUTION

This problem may be avoided by making sure that the array is not

the first in its segment. Two ways to do this are:

1. Don't declare the array as a far variable.

-or-

2. Declare a dummy far variable before the array.

STATUS

Microsoft has confirmed this to be a problem in C versions 6.0,

6.0a, and 6.0ax and QuickC versions 2.5 and 2.51 (buglist2.50 and

buglist2.51). This problem was corrected in C version 7.0.

More Information:

Sample Code

-----------

/* Compile options needed: none

*/

#include <stdio.h>

#include <conio.h>

#include <graph.h>

/* Uncomment the following line to work around the problem */

/* double _far bogus[] = {25.0, 0.0}; */

double _far first[] = {-78.3, 4.6, -76.3, 10.8, -69.6, 9.8,

-70.6, 5.0};

double _far second[] = {-60.6, 7.5, -55.6, 10.8, -47.7, 7.8,

-46.7, 5.3};

void main(void)

{

_setvideomode(_VRES16COLOR);

_setcolor(15);

_setwindow(1, 0, 0, -80.0, 12.0);

_outtext("First polygon: Second polygon:");

_polygon_w(_GBORDER, first, 4);

_polygon_w(_GBORDER, second, 4);

getch();

_setvideomode(_DEFAULTMODE);

}

Additional reference words: 6.00 6.00a 6.00ax