Packed structures in Norcroft - do they work yet?
Jeffrey Lee (213) 6048 posts |
While working on the USB drivers today I found that sizeof(usb_status_t) was wrong, due to packed structures being disabled via -DDISABLE_PACKED. After looking back through CVS I found that Ben Avison had disabled packed structures intentionally since “the compiler doesn’t seem to work correctly yet” (see usb.h revision 1.4). Obviously that change was over 6 years ago, and I’m not sure what date Norcroft 5.55 was released (which is the first version to support __packed according to Castle’s site), so I don’t know how valid that statement is today. So the question is, do packed structs work properly yet? For the moment I’ve put in a hard-coded value for sizeof(usb_status_t), but it would be nice to use packed structs and not have to worry about anything else being broken! Strangely the incorrect value worked fine for EHCI on my Beagleboard, and presumably works fine for EHCI/OHCI on an Iyonix, but was causing my MUSB driver to fail, so it had to be fixed one way or another. |
Steve Revill (20) 1361 posts |
Looking at the logs for the C compiler, there have been many changes and bug fixes since the version (5.55) which introduced packed structure support. However, as a lot of the change logs are of the “lots of bug fixes” sort, I can’t tell you if the problem Ben found in the USB drivers has or hasn’t been fixed. Which means it’s a case of suck it and see. :) |
Jeffrey Lee (213) 6048 posts |
Looks like they’re still broken :( |