------- Comment #7 from shenrfen at gmail dot com 2009-10-23 01:52 ------- What about the following case? There is not un-defined behavior. PS :Could you please tell me the full name of DR #120 documents. Thanks again.
struct s { unsigned long long a:2; unsigned long long b:40; unsigned long long c:22; }; int main() { struct s t = {1, 2, 3}; unsigned long long a = t.a - 8; unsigned long long b = t.b - 8; unsigned long long c = t.c - 8; printf("0x%llx\n",a); printf("0x%llx\n",b); printf("0x%llx\n",c); } Tht output is : 0xfffffffffffffff9 0xfffffffffa 0xfffffffffffffffb -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41793