Wno-packed flag not working?

John Morrison JMorrison@printronix.com
Thu Jun 12 21:04:00 GMT 2008


I would like to know if I'm making the wrong assumption about the
Wno-packed compile flag.  Should not this flag turn off warning messages
like this

	warning: 'packed' attribute ignored for field of type 'UCH'

Here are some of the 'define's

typedef unsigned char UCH;
typedef signed short int W;
#define SPACKD __attribute__((packed))

Here is the structure before macro substitution

typedef struct _device_request
{
	UCH bmRequestType SPACKD;
	UCH bRequest SPACKD;
	UW wValue SPACKD;
	UW wIndex SPACKD;
	UW wLength SPACKD;
} DEVICE_REQUEST;


And after

typedef struct _device_request
{
 UCH bmRequestType __attribute__((packed));
 UCH bRequest __attribute__((packed));
 UW wValue __attribute__((packed));
 UW wIndex __attribute__((packed));
 UW wLength __attribute__((packed));
} DEVICE_REQUEST;

I've verified that -Wno-packed was specified.

I just want to turn off the warning messages.  

Thanks
John Morrison
Printronix, Inc.



More information about the Gcc-help mailing list