www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/18/23:47:45

Date: 18 Jan 96 17:23:22 EST
From: Fulco Bohle <100662 DOT 3563 AT compuserve DOT com>
To: Delorie <djgpp AT delorie DOT com>
Subject: aligment / based pointers
Message-ID: <960118222321_100662.3563_EHV63-1@CompuServe.COM>

Hello,

1. I am porting sources from Microsoft C to DGGPP-C. what I need is 2-bytes
alignment for all structure elements.
DJGPP uses a default 4-bytes alignment strategy. 

Microsoft C uses a pragma for non standard alignment, for example

#pragma pack(4)		/* initiates 4-bytes alignment */

typedef struct
	{
	char	aap;		/* dutch for monkey */
	int	noot;		/* dutch for nut */
	} s_leesplankje;		/* this is how I learned to read */

sizeof (s_leesplankje) = max( sizeof( char), 4) + sizeof( int)

#pragma pack(2)		/* initiates 2-bytes alignment */

typedef struct
	{
	char	aap;
	int	noot;
	} s_leesplankje;

sizeof (s_leesplankje) = max( sizeof( char), 2) + sizeof( int)	

How do I obtain the same results in DGGPP-C

2. Does DJGPP-C understand based pointers ?

3. What is the main difference between djgpp verion 1.12 and 2.0 ?

Fulco Bohle

- Raw text -


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