🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3942

Turbo C++ bit field bug

#3942
From: Bryan S. So
Date: Sun, 16 Dec 1990 00:57
33 lines
1099 bytes
Does anybody from Borland read this newsgroup?  The following C
program hangs up if compiled with -ml under Turbo C++ (both 1.0 &
1.01).  No problem uner Small model.  No problem with MS C either.
Probably a problem with the bit field "calculated".  Can somebody
suggest a work around?


     #define MAX_UNITS 20
     
     typedef struct {
          double a;	
          double b;
          unsigned calculated: 1;	
     } unit;

     typedef struct {
	  double w[MAX_UNITS][MAX_UNITS];
	  unit u[MAX_UNITS];
     } nn;

     main()
     {
	  nn Net;
	  
	  Net.u[7].a = 0.70;
	  printf("%.2lf\n", (Net.u)[7].a);
	 
	  return 0;
     }


Bryan So
Technical Details
Message-ID: <1990Dec16.005724.8602@spool.cs.wisc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwvax!brownie.cs.wisc.edu!so

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwvax!brownie.cs.wisc.edu!so
From: so@brownie.cs.wisc.edu (Bryan S. So)
Newsgroups: comp.os.msdos.programmer
Subject: Turbo C++ bit field bug
Message-ID: <1990Dec16.005724.8602@spool.cs.wisc.edu>
Date: 16 Dec 90 00:57:24 GMT
Sender: news@spool.cs.wisc.edu (The News)
Organization: U of Wisconsin CS Dept
Lines: 33
Originator: so@brownie.cs.wisc.edu