delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/04/09:31:16

From: "Alexandre Devaure" <Alexandre DOT Devaure AT leroy-autom DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000504092557 DOT 16176B-100000 AT is> <005b01bfb593$eb5b1c60$3eefa8c0 AT leroyautom DOT com> <200005041044 DOT MAA17219 AT maggiore DOT iperbole DOT bologna DOT it>
Subject: Re: structures size
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Message-ID: <gveQ4.3805$cV7.8562787@nnrp5.proxad.net>
Date: Thu, 04 May 2000 12:59:56 GMT
NNTP-Posting-Host: 194.51.236.59
X-Complaints-To: abuse AT proxad DOT net
X-Trace: nnrp5.proxad.net 957445196 194.51.236.59 (Thu, 04 May 2000 14:59:56 CEST)
NNTP-Posting-Date: Thu, 04 May 2000 14:59:56 CEST
Organization: Guest of ProXad - France
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

pad2369 <pad2369 AT iperbole DOT bologna DOT it> a écrit dans le message :
200005041044 DOT MAA17219 AT maggiore DOT iperbole DOT bologna DOT it...
> Alexandre Devaure <Alexandre DOT Devaure AT leroy-autom DOT com>:
> > Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
> > > On Wed, 3 May 2000, Alexandre Devaure wrote:
> > >
> > > > I'd like the size of my structures is the same
> that in Borland C
> > because
> > my
> > > > program need to read a structure in flash written
> by a program
> > developed
> > > > under Borland C. So, I want to use the -fpack-
> struct option at
> > compilation
> > > > time. But it has no effect on the structure size
> and I need to add the
> > > > packed attribute on each structure.
> > >
> > > C programs or C++ programs?
> > >
> > > Can you post a short test program and its
> compilation command line, which
> > > can be used to reproduce this problem?
> > >
> >
> >
> > This is a C program :
> >
> > #include <stdio.h>
> >
> > struct l {
> >         uchar c;
> >         uint o;
> >         uint s;
> > };
> > struct st {
> >         struct l l;
> >         ulong d;
> >         uchar i;
> >         uchar t;
> >         ulong n;
> > };
> >
> > main()
> > {
> >         printf("%d\n",sizeof(struct st));
> > }
> >
> > the command line is gcc -fpack-struct file.c
>
> Quoting section 22.11 of the FAQ list (v2.30):
>
>   GCC 2.95.1 and 2.95.2 had bugs in their support of
>   -fpack-struct (the bug is corrected in v2.96 and
>   later).

the bug *is* or *will be* corrected in v2.96 because the lastest version I
saw at delorie site or gnu site is 2.95.2
TIA
Alex


- Raw text -


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