我正在使用QtCreator开发一个C项目(是的,它主要用于C++,但到目前为止,它还可以用于C语言)。
现在,我在编译正常的有效代码上看到红色下划线:
它基本上是一个虚拟COM端口的this未更改的libopencm3示例项目。
你能在代码中看到一些问题吗,也许不是致命的,但是是什么让编辑器认为这是一个错误呢?
我试着用一个等价的类型定义函数替换struct usb_device_descriptor
,但是没有用。
第二行错误显示"expected },Get.“。结束的}
被注释为"extra ;`
下面是该结构的声明方式:
/* USB Standard Device Descriptor - Table 9-8 */
struct usb_device_descriptor {
uint8_t bLength;
uint8_t bDescriptorType;
uint16_t bcdUSB;
uint8_t bDeviceClass;
uint8_t bDeviceSubClass;
uint8_t bDeviceProtocol;
uint8_t bMaxPacketSize0;
uint16_t idVendor;
uint16_t idProduct;
uint16_t bcdDevice;
uint8_t iManufacturer;
uint8_t iProduct;
uint8_t iSerialNumber;
uint8_t bNumConfigurations;
} __attribute__((packed));
发布于 2015-10-26 22:33:23
https://stackoverflow.com/questions/33346956
复制相似问题