public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "warg0d at go2 dot pl" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/25274] New: sizeof(struct) fails for 'unlucky' structure Date: Tue, 06 Dec 2005 12:43:00 -0000 [thread overview] Message-ID: <bug-25274-11823@http.gcc.gnu.org/bugzilla/> (raw) the bug is in sizeof(element) - i've made unlucky structure, some time ago, where sum of sizeof(each_element) gives size of 14 and sizeof(whole_struct) returns 16. on old gcc-2.9.x there was the same problem. as an example program i've wrote shor one, that shows sizeof() from struct having 14 char's table, 'unlucky' struct and sum of all elements sizes. // sizeof(a)==16B instead of 14B... struct a { char bfType[2];// 2B unsigned long bfSize;// 4B unsigned short bfReserved1;// 2B unsigned short bfReserved2;// 2B unsigned long bfOffBits;// 4B }; // sizeof(b)==14B - OK! struct b { char nothing[14]; }; -- Summary: sizeof(struct) fails for 'unlucky' structure Product: gcc Version: 3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: warg0d at go2 dot pl GCC build triplet: x86 GCC host triplet: x86 GCC target triplet: x86 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25274
next reply other threads:[~2005-12-06 12:43 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-12-06 12:43 warg0d at go2 dot pl [this message] 2005-12-06 13:08 ` [Bug c/25274] " rguenth at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-25274-11823@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).