Am 30.08.2011 20:29, schrieb Paolo Bonzini:
On 08/30/2011 07:57 PM, Blue Swirl wrote:
>
>  +#if defined(_WIN32)
>  +# define QEMU_PACKED __attribute__((gcc_struct, packed))
Maybe we could also use gcc_struct also for non-win32?

>  +#else
>  +# define QEMU_PACKED __attribute__((packed))
>  +#endif

Indeed.

Paolo


No. Extract from gcc documentation:

"Two attributes are currently defined for i386 configurations: |ms_struct| and |gcc_struct"

For non i386 configuration, these configurations are undefined:

mipsel-linux-gnu-gcc -c -Wall test.c
test.c:3: warning: ‘gcc_struct’ attribute directive ignored

Therefore, we cannot use gcc_struct for most supported hosts.
Linux i386 or x86_64 would support it, but they don't need it...

We need one #if ... #else ... #endif to avoid 250 of them :-)

Stefan

|

Reply via email to