delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/10/01:17:07

Xref: news2.mv.net comp.os.msdos.djgpp:3654
From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: more sizeof questions
Date: Thu, 09 May 1996 18:39:38 -0700
Organization: Alcyone Systems
Lines: 17
Message-ID: <31929E5A.1FC3F360@alcyone.com>
References: <199605090048 DOT UAA09442 AT eelab DOT newpaltz DOT edu>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

John Fortin wrote:

> OK, I'm a bit confused..(nothing new i'm afraid)... The structure
> below was taken from the VESA 1.2 spec. sizeof(_VGAInfoBlock) should
> be 256.  DJGPP gives 260.  What's up with this.

This is an ANSI C question, not a DJGPP one.  Structure padding is allowed in
ANSI C, and the way it is done is implementation-dependent.  Attempting to use
a structure to represent data like this is inherently
implementation-dependent.  You should be manipulating one member at a time.

-- 
Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max AT alcyone 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. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
"Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_

- Raw text -


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