delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/07/03/09:52:41

From: jojo AT esil DOT univ-mrs DOT fr (Jean-Francois Morcillo)
Subject: Re: B19: -fpack-struct dows not work
3 Jul 1998 09:52:41 -0700 :
Message-ID: <Pine.SOL.3.95.980703064834.15404B-100000.cygnus.gnu-win32@predator>
References: <000101bda5a2$876db1c0$0202a8c0 AT svu DOT pir DOT spb DOT ru>
Mime-Version: 1.0
To: Sergey Udaltsov <svu AT mcr DOT spb DOT ru>
Cc: gnu-win32 AT cygnus DOT com


On Thu, 2 Jul 1998, Sergey Udaltsov wrote:

> Dear sirs:
> 
> We've tryed to compile the following lines using gcc:
> 
> struct s
> {
>   char c;
>   long l;
> };

I think it's right because of memory alignement. Normaly long are place at
memory address multiple of 4. So there is a hole of 3 bytes between c and
l in memory. May be with the paked attribute the compiler does'nt do the
same alignements?



 > > using option -fpack-struct.
> sizeof (s) returned 8. Is it right?
> 
> When I added __attribute__ ((packed)), sizeof(s) became 5.
> So, for now the command-line option does not work the same way as struct
> attribute.
> 
> Platform: CYGWIN32 B19 / NT4.0
> 
> Best regards,
> 
> Sergey V. Udaltsov
> 
> -
> For help on using this list (especially unsubscribing), send a message to
> "gnu-win32-request AT cygnus DOT com" with one line of text: "help".
> 

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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