Microsoft KB Archive/33379

Pointer Optimization Problems with QuickC Version 1.01 PSS ID Number: Q33379 Article last modified on 10-12-1988 PSS database name: S_QuickC

1.01

MS-DOS

Summary: Using pointers to pass values between storage locations will fail when the pointers are declared as static and the program is compiled with optimizations. This problem occurs when you use QCL; however, this problem does not occur in C Version 5.10. Microsoft has confirmed this to be a problem in Version 1.01 of the Quick C compiler. We are researching this problem and will post new information as it becomes available.

More Information: The line

px = py;

of the following program does nothing; however, it should change “x” and &quot;*px&quot; to the value of 1.

void main(void);

void main { static int x = 0; static int y = 1; static int z = 2; static int px = &x; static int py = &y; static int *pz = &z;

z=*px; *px = *py; *py=z;

return; }

Copyright Microsoft Corporation 1988.