Reputation: 18901
I'm working in a C project with QtCreator (yes it's primarily for C++, but so far it worked OK for C).
Now I'm getting a red underline on a valid code that compiles fine:
It's basically this unchanged libopencm3 example project for a Virtual COM port.
Can you see some problem in the code, perhaps not fatal, but what could make the editor think it's an error?
I tried substituting struct usb_device_descriptor
with an equivalent typedef, but that didn't help.
Error on the second line says "expected }, got .". The closing }
is annotated as "extra ;`
Here's how the struct is declared:
/* 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));
Upvotes: 4
Views: 1727
Reputation: 18901
Found a workaround:
Change the value for "C" to Clang in this settings page:
(As m.s. points out in the comments, you may have to enable the model first)
Upvotes: 1