TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Paul Edwards
date: 1995-01-01 00:17:56
subject: watcom 10.0a bug

/*********************************************************************/
/*                                                                   */
/*  This program demonstrates what I believe is a bug in             */
/*  Watcom C 10.0a.  If you compile this program as                  */
/*  "wcl386 prog.c" and run it it says "mismatch" which
I don't      */
/*  think should happen.  I have stripped it down to the             */
/*  minimum required to demonstrate the problem.                     */
/*                                                                   */
/*  If you have a fix for this, please contact Paul Edwards,         */
/*  Fidonet 3:711/934.                                               */
/*                                                                   */
/*********************************************************************/

#include 
#include 

struct mystruct
{
    void __far16 * x;
};

struct mystruct abc;
struct mystruct __far16 * def;

void __far16 * myptr;

long g;

void foo(void __far16 *p) { return; }

int main(void)
{
  def = &abc;
  def->x = &g;
  foo(&abc);    /* comment out this line for a similar bug!!!!!! */
  myptr = (void __far16 *)def->x;
  
  if (memcmp(&myptr, &def->x, 4) != 0)
  {
      printf("mismatch\n");
  }
  else
  {
      printf("ok\n");
  }
  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™.