From: SourceForge.net <no...@so...> - 2008-11-15 14:31:37
|
Feature Requests item #2291335, was opened at 2008-11-15 15:28 Message generated for change (Comment added) made by borutr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=2291335&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Priority: 5 Private: No Submitted By: Borut Ražem (borutr) Assigned to: Borut Ražem (borutr) Summary: Unnamed bit-field initialization Initial Comment: I found a inconsistency between sdcc and gcc regarding unnamed bit-field initialization: struct { int a : 2; char : 2; int b : 2; } s = {1, 2, 3}; - in sdcc it means: s.a = 1; s.b = 3; - in gcc it means: s.a = 1; s.b = 2; and gcc throws a warning: t.c:6: warning: excess elements in struct initializer t.c:6: warning: (near initialization for `s') - msvc behaves in the same way as gcc I haven't found the explanation in the ISO/IEC 9899:1999 standard how the compiler should handle unnamed bit-field initialization. Maybe it is implicitly specified somewhere. I propose to change unnamed bit-field initialization to be gcc compatible. Borut ---------------------------------------------------------------------- >Comment By: Borut Ražem (borutr) Date: 2008-11-15 15:31 Message: Fixed in svn revision #5267. Borut ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=2291335&group_id=599 |