| Summary: | usb.h uses a variable name "class" which conflicts with C++ | ||
|---|---|---|---|
| Product: | Base System | Reporter: | seagull <seagull> |
| Component: | kern | Assignee: | Nick Hibma <n_hibma> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.4-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
Responsible Changed From-To: freebsd-bugs->n_hibma Over to Mr. USB State Changed From-To: open->closed Fixed in revision 1.30 of usb.h (CURRENT). |
In /usr/include/dev/usb/usb.h line 501, the definition for struct usb_device_info includes the following member: u_int8_t class; /* bDeviceClass */ Since "class" is a C++ keyword, this breaks C++ sources that attempt to #include this file. Fix: Don't use 'class' as a variable name. How-To-Repeat: Compile this with C++ #include <dev/usb/usb.h> int main (int argc, char **argv) { return 0; } You'll get this: In file included from foo.cc:1: /usr/include/dev/usb/usb.h:501: syntax error before `;'