IMHO this is better practice
#pragma warning(push)
#pragma warning(disable :4214) // some comment as to why this was a good idea
…
#pragma warning(pop)
Sent from Surface Pro
From: Don Burn
Sent: Thursday, August 28, 2014 12:40 PM
To: Windows System Software Devs Interest List
Use #pragma warning(disable:4214) … #pragma warning(default:4214) around
the whole structure.
Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@compuserve.com
Sent: Thursday, August 28, 2014 12:34 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Visual Studio 2013 WDK8.1 - bitfields
I’m trying to compile my SCSI tape drivers for 32-bit and 64-bit using
Visual Studio 2013 and WDK 8.1 (don’t laugh). I notice that there are no
tape driver samples in the WDK - or have I missed something?
This doesn’t compile:
typedef struct _MODE_DATA_COMPRESSION_PAGE {
UCHAR PageCode : 6;
UCHAR Reserved1 : 2;
UCHAR PageLength;
UCHAR Reserved2 : 6;
UCHAR DCC : 1;
UCHAR DCE : 1;
UCHAR Reserved3 : 5;
UCHAR RED : 2;
UCHAR DDE : 1;
UCHAR CompressionAlgorithm[4];
UCHAR DecompressionAlgorithm[4];
UCHAR Reserved4[4];
} MODE_DATA_COMPRESSION_PAGE, *PMODE_DATA_COMPRESSION_PAGE;
warning C4214: nonstandard extension used : bit field types other than int
I could put a #pragma warning(suppress:4214) in front of every UCHAR, but
is there a better way? /Ze doesn’t work as it’s been deprecated.
Regards, Richard.
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer