On 13 jun 2007, at 04:09, Waldek Hebisch wrote:
AFAIK this padding is part of C language specification.
Yesterday, during my searches I found a gcc internals document which said that the C language specification defines it as part of the ABI specification. I can't find it anymore now though.
What other langages do is subject to language/compiler specification. In particular, I think that Ada requires support for arbitrary bitfield layout (including bitfields that go across word boundaries). I belive that current gpc behaviour is a concious decision to have better semantics that the one given by C. gcc backends is flexible, AFAIK gpc just uses backend support.
gcc indeed supports several different ways to bitpack (based on directives, e.g. there's one for MSVC-compatible bitpacking).
IMHO gdb should just correctly display such bitfields in gpc generated programs -- if not there is bug somewhere. ATM I can not say if the bug is in gpc frontend (missing some annotations) gcc buckend (emmiting incorrect debug info), gdb (mishandling debug info) or maybe brain damaged specification of debug info (basic stabs can handle only simple cases and frequently require nonstandard extensions).
The debug info looks standard and fine to me. I think it's a bug in the gdb value reading routine.
Jonas