Mail Archives: djgpp/1998/05/02/01:16:04
At 11:07 5/1/1998 -0700, WT wrote:
>I am trying to write a short program to detect VESA VBE and output
>information about the video card. I declared a struct of 512 bytes to be
>used as a buffer for vbe_info_block. The strange thing is that when I
>printed sizeof(vbe_info_block) it gave me 516 bytes instead of 512. I am
>sure my struct is correct because I've checked it many times. This is
>how the struct is declared :
[snipped]
>Could it be something wrong with the int declaration? Please help!
It's from the fact that GCC aligns struct members. This is a feature. FAQ
section 22.9 talks about this indirectly, and has pointers to the sections
of the GCC docs which say how to fix it.
Nate Eldredge
nate AT cartsys DOT com
- Raw text -