This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/14786] Struct misaligned containing unsigned char bit-field


------- Additional Comments From ryanma at cpsc dot ucalgary dot ca  2004-03-31 15:35 -------
http://publib.boulder.ibm.com/infocenter/comphelp/topic/com.ibm.vacpp6a.doc/prog
uide/ref/rvclralg.htm

The xlc compiler exhibits the expected behavior.

$ xlc t.c -qlanglvl=extended
"t.c", line 5.25: 1506-159 (E) Bit-field type specified for a is not valid. 
Type unsigned assumed.
"t.c", line 6.25: 1506-159 (E) Bit-field type specified for b is not valid. 
Type unsigned assumed.
"t.c", line 7.25: 1506-159 (E) Bit-field type specified for c is not valid. 
Type unsigned assumed.
"t.c", line 8.25: 1506-159 (E) Bit-field type specified for d is not valid. 
Type unsigned assumed.
"t.c", line 9.25: 1506-159 (E) Bit-field type specified for e is not valid. 
Type unsigned assumed.
"t.c", line 10.25: 1506-159 (E) Bit-field type specified for f is not valid. 
Type unsigned assumed.
"t.c", line 11.25: 1506-159 (E) Bit-field type specified for g is not valid. 
Type unsigned assumed.
"t.c", line 12.25: 1506-159 (E) Bit-field type specified for h is not valid. 
Type unsigned assumed.
"t.c", line 13.25: 1506-159 (E) Bit-field type specified for i is not valid. 
Type unsigned assumed.
"t.c", line 14.25: 1506-159 (E) Bit-field type specified for J is not valid. 
Type unsigned assumed.
"t.c", line 15.25: 1506-159 (E) Bit-field type specified for K is not valid. 
Type unsigned assumed.
./a.out
$ ./a.out
Address of Struct =2ff22a20
sizeof(SubStruct) =4
sizeof(Struct)    =20
 offset of B      =8
 offset of C      =12
 offset of D      =13


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14786


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]