Xref: utzoo comp.unix.xenix.sco:1780 comp.unix.sysv386:5386 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!uupsi!sunic!fuug!demos!ache From: ache@hq.demos.su (Andrew A. Chernov) Newsgroups: comp.unix.xenix.sco,comp.unix.sysv386 Subject: Microsoft C offsets BUG in 386's Message-ID: <1991Feb23.175948.842@hq.demos.su> Date: 23 Feb 91 17:59:48 GMT Organization: DEMOS, Moscow, USSR Lines: 45 Hi, folks! I've found Microsoft C compiler bug in computation offsets in structures on my XENIX/386 v2.3.3: if any field exceed 64K, offsets of next fields are WRONG. And so, Microsoft programmers can't write their products without DIRTY bugs. Use your Microsoft C CAREFULLY! May be, it can damage all (and you brains also) in one day! I've check this problem with 'gcc', and get CORRECT result. NOTE: if you have 286 computer, don't worry about this: you can't make object bigger than 64K. This is my test to detect error in your compiler: ------------------------------ CUT HERE ------------------------------- #define SIZE_OVER_64K 100000 struct { char a[SIZE_OVER_64K]; char junk[100]; int b; } c; main() { int i; c.b = 1; for(i = 0; i < SIZE_OVER_64K; i++) if(c.a[i] != 0) { printf("THIS 32-bit C COMPILER IS BUGGY !\n"); exit(1); } printf("NO ERRORS FOUND.\n"); exit(0); } ------------------------------ CUT HERE ------------------------------- -- In-Real-Life: Andrew A. Chernov | Domain: ache@hq.demos.su, Zodiac-Sign: Virgo | ache%hq.demos.su@relay.eu.net Organization: DEMOS Coop., | Phone: +7 095 2312129 Moscow, Russia | Fax: +7 095 2335016