Date: Sun, 23 Mar 1997 14:34:17 +0300 (IDT) From: Eli Zaretskii To: Regis BOSSUT cc: djgpp AT delorie DOT com Subject: Re: A simple program that works except under GDB... In-Reply-To: <333251F7.6AEA@isen.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 21 Mar 1997, Regis BOSSUT wrote: > 1) The packed attribute is not of any help, since the items of ncb are > already correctly aligned. Did you actually tried to add ``__attribute__(packed))''? Because I think that you are wrong in assuming that NCB is already aligned. Here: > #define BYTE unsigned char > #define WORD unsigned short > #define DWORD unsigned int > > typedef struct { > BYTE ncb_command; > #define NCBASTAT 0x33 > BYTE ncb_retcode, ncb_lsn, ncb_num; > char *ncb_buffer; WORD ncb_length; > BYTE ncb_callname[16], ncb_name[16]; > BYTE ncb_rto, ncb_sto; > int (*ncb_post)(); <<<<<<<<<<<< > BYTE ncb_lana_num, ncb_cmd_cplt; <<<<<<<<<<<< > char *ncb_vname; <<<<<<<<<<<< > BYTE ncb_vnamelen; > BYTE ncb_reserve[9]; > } NCB; The 3 marked lines show that *ncb_vname (a 4-byte pointer) is not aligned, because there are only 2 bytes between it and the preceding (*ncb_post)(), which is a 4-byte pointer to a function. Am I missing something?