[Bug pending/17250] New:
gcc-bugzilla at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Aug 31 12:53:00 GMT 2004
NOTE: Defaulting component because reported component no longer exists
I just compile this code below and the sizeof yield wrong size for this stucture, haven't tried it at other machine yet. The code is:
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. I suspect that the bug is on the sizeof. And please notify me about this bug (fix, explaination, anything), thank you!
Environment:
System: Linux xhell 2.6.8xhell #3 Tue Aug 31 13:06:30 WIT 2004 i686 unknown unknown GNU/Linux
Architecture: i686
host: i486-slackware-linux-gnu
build: i486-slackware-linux-gnu
target: i486-slackware-linux-gnu
configured with: ../gcc-3.3.4/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux
How-To-Repeat:
Just compile any code that use sizeof to find out the size of the structure.
------- Additional Comments From david at xhell dot goo 2004-08-31 12:53 -------
Fix:
Haven't found any fix yet, but I get around by using sizeof to the elements of the structure
--
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: pending
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: david at xhell dot goo
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i486-slackware-linux-gnu
GCC host triplet: i486-slackware-linux-gnu
GCC target triplet: i486-slackware-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17250
More information about the Gcc-bugs
mailing list