/*********************************************************************/
/* */
/* This program demonstrates a problem with Borland C++ 1.5 for */
/* OS/2. Compiled with bcc -S prob.c, it produces the code */
/* shown in bad.asm. When compiled with BC++ 1.0, it produces */
/* code good.asm. */
/* */
/* This code has been stripped down to the minimum required to */
/* demonstrate the problem. You will see that in bad.asm there */
/* is no thunking done when accessing via the structure. */
/* */
/* If you have a bug fix for this, could you please notify */
/* Paul Edwards, Fidonet 3:711/934. */
/* */
/*********************************************************************/
#include
struct mystruct {
int x;
};
struct mystruct __far16 *func(void);
int main(void)
{
struct mystruct __far16 *a;
a = func();
printf("x is %d\n", a->x);
return (0);
}
@EOT:
--- Mksmsg
* Origin: none (3:711/934.9)
|