delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/19/03:49:27

From: pavenis AT lanet DOT lv
To: djgpp AT delorie DOT com
Date: Thu, 19 Apr 2001 10:48:14 +0300
MIME-Version: 1.0
Subject: Re: MINGW vs DJGPP
Message-ID: <3ADEC26E.22249.5630F@localhost>
In-reply-to: <slrn9drndf.jqc.rpolzer@www42.t-offline.de>
X-mailer: Pegasus Mail for Win32 (v3.12c)
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 18 Apr 2001, at 20:32, echo 'Rudolf Polzer' wrote:

> > > > > 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?
> 

No. It doesn't work for C++. So best I can currently suggest is to avoid 
using broken -fpack-struct and use pair of #pragma pack(1) and 
#pragma pack() where needed. This is better as You can pack only 
those structures You really need. 

Andris


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019