TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Paul Edwards
date: 1994-12-31 22:24:46
subject: prob.c

/*********************************************************************/
/*                                                                   */
/*  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)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.