Xref: news-dnh.mv.net comp.os.msdos.djgpp:1271 Path: news-dnh.mv.net!mv!news.sprintlink.net!simtel!harbinger.cc.monash.edu.au!silas.cc.monash.edu.au!junaid From: junaid AT silas DOT cc DOT monash DOT edu DOT au (Mr A. Walker) Newsgroups: comp.os.msdos.djgpp Subject: Re: GCC/DJGPP Weirdness (structure padding stuff) Date: 31 Jul 1995 11:18:50 GMT Organization: Monash University Lines: 19 References: Nntp-Posting-Host: silas.cc.monash.edu.au To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote: : On Fri, 28 Jul 1995, A.Appleyard wrote: : > Why not pack structs etc anyway by default? On a PC, (rounding every member's : > width to a multiple of 2 or 4 bytes) achieves nothing except wasting store and : > annoying people who want to make a struct match some assembly-coded table (as : > e.g. when calling some interrupts). : This is not true. There is a considerable penalty on a 486 or better CPU : for unaligned accesses, so even on a PC struct padding makes a lot of I think what was originally intended, was that shorts were 2-byte aligned and ints where 4-byte aligned. As you would expect, a multiple of 2 shorts must be used consecutively to preserve int alignment (otherwise gcc must pad a short). This then would work intuitively. Junaid