I am trying to compile a file that uses one of the pre-defined IOCTL codes
in usbioctl.h.
I am getting build errors (C2220 and C4200) because this file has some data
type definitions with zero-length arrays. For example, the Data array in the
typed below is zero length, and causes such an error.

typedef struct _USB_DESCRIPTOR_REQUEST {
ULONG ConnectionIndex;
struct {
UCHAR bmRequest;
UCHAR bRequest;
USHORT wValue;
USHORT wIndex;
USHORT wLength;
} SetupPacket;
UCHAR Data[0];
} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST;

I also notice a disturbing pragma statement near the beginning of the file:
#pragma message ("warning: using obsolete header file usbioctl.h")
It confuses me further that I don't see this message in my console window
when I do my build.

This version of the header shipped with the latest DDK, so I'm confused.

Can anyone shed some light on this?

FYI: I'm doing a checked build.

Thanks in advance for the help,
Dennis

Re: Compile Errors when using usbioctl.h by Tim

Tim
Wed Jul 21 22:22:13 CDT 2004

"Dennis Burns" <dburns@rtessentials.com> wrote:

>I am trying to compile a file that uses one of the pre-defined IOCTL codes
>in usbioctl.h.
>I am getting build errors (C2220 and C4200) because this file has some data
>type definitions with zero-length arrays.

Feel free to wrap the #include to suppress the warning:
#pragma warning(disable:c2220)
#include <usbioctl.h>
#pragma warning(default:c2220)

>I also notice a disturbing pragma statement near the beginning of the file:
>#pragma message ("warning: using obsolete header file usbioctl.h")
>It confuses me further that I don't see this message in my console window
>when I do my build.

There are 9 versions of usbioctl.h in the DDK. Only a few of them (the
Windows 2003 versions) include the obsolete warning. If you're building
with the WinXP DDK shell, you won't see the warning.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc

Re: Compile Errors when using usbioctl.h by Dennis

Dennis
Thu Jul 22 06:29:07 CDT 2004

Hi Tim,
Thanks for the help.
Dennis

"Tim Roberts" <timr@probo.com> wrote in message
news:dgcuf0hrs971mmqd7iq8k3ck0vpkid304m@4ax.com...
> "Dennis Burns" <dburns@rtessentials.com> wrote:
>
> >I am trying to compile a file that uses one of the pre-defined IOCTL
codes
> >in usbioctl.h.
> >I am getting build errors (C2220 and C4200) because this file has some
data
> >type definitions with zero-length arrays.
>
> Feel free to wrap the #include to suppress the warning:
> #pragma warning(disable:c2220)
> #include <usbioctl.h>
> #pragma warning(default:c2220)
>
> >I also notice a disturbing pragma statement near the beginning of the
file:
> >#pragma message ("warning: using obsolete header file usbioctl.h")
> >It confuses me further that I don't see this message in my console window
> >when I do my build.
>
> There are 9 versions of usbioctl.h in the DDK. Only a few of them (the
> Windows 2003 versions) include the obsolete warning. If you're building
> with the WinXP DDK shell, you won't see the warning.
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc



Re: Compile Errors when using usbioctl.h by Tim

Tim
Fri Jul 23 21:45:30 CDT 2004

Tim Roberts <timr@probo.com> wrote:

>"Dennis Burns" <dburns@rtessentials.com> wrote:
>
>>I am trying to compile a file that uses one of the pre-defined IOCTL codes
>>in usbioctl.h.
>>I am getting build errors (C2220 and C4200) because this file has some data
>>type definitions with zero-length arrays.
>
>Feel free to wrap the #include to suppress the warning:
> #pragma warning(disable:c2220)
> #include <usbioctl.h>
> #pragma warning(default:c2220)

Whoops, as I was reading my own reply, my internal compiler faulted. The
warning numbers should not have the letter "c":

#pragma warning(disable:2220)
#include <usbioctl.h>
#pragma warning(default:2220)
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc