Bug 31391

Summary: usb.h uses a variable name "class" which conflicts with C++
Product: Base System Reporter: seagull <seagull>
Component: kernAssignee: Nick Hibma <n_hibma>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.4-RELEASE   
Hardware: Any   
OS: Any   

Description seagull 2001-10-20 21:20:00 UTC
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 `;'
Comment 1 Doug Barton freebsd_committer freebsd_triage 2001-10-21 20:02:19 UTC
Responsible Changed
From-To: freebsd-bugs->n_hibma


Over to Mr. USB
Comment 2 Nick Hibma freebsd_committer freebsd_triage 2002-02-24 11:16:48 UTC
State Changed
From-To: open->closed

Fixed in revision 1.30 of usb.h (CURRENT).