Bug in gcc?

Leon Pollak leonp at plris.com
Thu Jun 5 15:41:20 UTC 2008


Hello, all.

It seems to me I found a bug in gcc, but as it is rtems-provided cross-gcc, I 
think it was better to ask here first.

I have the following code:
template <class TYPE> class sCmnd2DSPs {
public:
	enum eSources {eDiscr=0, eRS1, eRS2, 
		eMB1, eMB2, eEth1, eEth2} __attribute__ ((packed));
	struct {
		eSources	Source;
		uchar		Addr;
		eCmndCodesDSPs	Opcode;
		TYPE		Params; } __attribute__ ((packed));
...............
};

Everything works fine, but the field Source in the code above occupies 4 
bytes, despite the packed request.

Now, if I take the enumeration declaration out of the class (put it above the 
class declaration), then the Source field occupies 1 byte as required.

Should I report this to gcc list?

Thanks.
-- 
Leon



More information about the users mailing list