Xref: news-dnh.mv.net comp.os.msdos.djgpp:2974 Path: news-dnh.mv.net!mv!news.sprintlink.net!newsfeed.internetmci.com!in2.uu.net!genmagic!goonsquad.spies.com!uuwest!alcyone!max From: max AT alcyone DOT darkside DOT com (Erik Max Francis) Newsgroups: comp.os.msdos.djgpp Subject: Re: Determining proper sizeof a struct Date: Tue, 31 Oct 95 07:34:57 PST References: Organization: &tSftDotIotE Lines: 17 To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp Eli Zaretskii writes: > Gcc (and other 32-bit compilers) pad structures so that they could be > accessed faster by 32-bit processors (there is a penalty of accessing > unaligned addresses). It is usually wrong to assume that sizeof of a > struct is the sum of the sizes of its fields; . . . In fact, the ANSI C standard indicates that there can be padding, so assuming that thtere is no padding is not only not generally right, but also violates the ANSI standard. Erik Max Francis, &tSftDotIotE || uuwest!alcyone!max, max AT alcyone DOT darkside DOT com San Jose, California, U.S.A. || 37 20 07 N 121 53 38 W || the 4th R is respect H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- || 1love || folasade _Omnia quia sunt, lumina sunt._ || GIGO Omega Psi || http://www.spies.com/max/ "Hands that once picked cotton can now pick Presidents." -- Jesse Jackson