Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

gcc vs c89 (aka cl.exe)

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Windows Server 2003 R2 SUA >> gcc vs c89 (aka cl.exe) Page: [1]
Login
Message << Older Topic   Newer Topic >>
gcc vs c89 (aka cl.exe) - Mar. 15, '06, 10:13:19 AM   
rjnorman

 

Posts: 12
Joined: Jan. 27, '06,
Status: offline
My application has many flags implemented as follows:
long flg1:1;
long flg2:1;
.etc...
In one structure I have 64 of these flags in a row. On most other Unix/Linux systems these 64 flag bits take up 8 bytes. Using c89 they take up 8 bytes, but using gcc they seem to be assigned 24 bytes.

Does anyone have an idea how I can tell gcc to treat this the same as c89 and all other C compilers?

Thanks
Post #: 1
RE: gcc vs c89 (aka cl.exe) - Mar. 16, '06, 4:42:20 PM   
rjnorman

 

Posts: 12
Joined: Jan. 27, '06,
Status: offline
I found the bug. I actually had nothing to do with bit fields. My struct also had an arrary of some other struct.
If that array did not begin on an 8 byte boundary then gcc would compute the offset of the fields following the array incorrectly. If I inserted an ' int filler; ' before my array then gcc computes the field offsets the same as c89.

So this looks like a bug in gcc.

Cheers

(in reply to rjnorman)
Post #: 2
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Windows Server 2003 R2 SUA >> gcc vs c89 (aka cl.exe) Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.031