From nobody@FreeBSD.org  Sat Oct 20 13:18:33 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id BFECB37B405
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 20 Oct 2001 13:18:32 -0700 (PDT)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f9KKIWO11342;
	Sat, 20 Oct 2001 13:18:32 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200110202018.f9KKIWO11342@freefall.freebsd.org>
Date: Sat, 20 Oct 2001 13:18:32 -0700 (PDT)
From: John Mechalas <seagull@aracnet.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: usb.h uses a variable name "class" which conflicts with C++
X-Send-Pr-Version: www-1.0

>Number:         31391
>Category:       kern
>Synopsis:       usb.h uses a variable name "class" which conflicts with C++
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    n_hibma
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 20 13:20:00 PDT 2001
>Closed-Date:    Sun Feb 24 03:16:48 PST 2002
>Last-Modified:  Sun Feb 24 03:18:48 PST 2002
>Originator:     John Mechalas
>Release:        4.4-RELEASE
>Organization:
>Environment:
FreeBSD ebony 4.4-RELEASE FreeBSD 4.4-RELEASE #9: Thu Oct  4 20:40:11 PDT 2001     root@ebony:/usr/src/sys/compile/THINKPAD  i386

>Description:
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.


>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 `;'


>Fix:
Don't use 'class' as a variable name.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->n_hibma 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sun Oct 21 12:02:19 PDT 2001 
Responsible-Changed-Why:  

Over to Mr. USB 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31391 
State-Changed-From-To: open->closed 
State-Changed-By: n_hibma 
State-Changed-When: Sun Feb 24 03:16:48 PST 2002 
State-Changed-Why:  
Fixed in revision 1.30 of usb.h (CURRENT). 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31391 
>Unformatted:
