[Bug pending/17250] struct size

falk at debian dot org gcc-bugzilla@gcc.gnu.org
Tue Aug 31 13:00:00 GMT 2004


------- Additional Comments From falk at debian dot org  2004-08-31 13:00 -------
(In reply to comment #0)
> 	typedef struct tagBITMAPFILEHEADER {
> 		unsigned short bfType;
> 		unsigned long   bfSize;
>         	unsigned short  bfReserved1;
>         	unsigned short  bfReserved2;
>         	unsigned long   bfOffBits;
> 	} BITMAPFILEHEADER;
> 
> 	When I try to find the size of the structure above using sizeof I get 16 but
it supposed to be 14.

No, it's not; there are two padding bytes before bfSize to ensure it is 4-byte
aligned.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID
            Summary|                            |struct size


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17250



More information about the Gcc-bugs mailing list