Date: Sat, 8 Jan 2000 03:09:14 -0800 (PST) From: afo@zlug.org To: freebsd-gnats-submit@FreeBSD.org Subject: kern/15983: C++ keywords in kernel header files Message-ID: <20000108110914.0394814CC1@hub.freebsd.org>
index | next in thread | raw e-mail
>Number: 15983
>Category: kern
>Synopsis: C++ keywords in kernel header files
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sat Jan 8 03:10:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Andre Fornacon
>Release: FreeBSD 3.3R
>Organization:
zLUG
>Environment:
FreeBSD rox.zlug.org 3.3-RELEASE FreeBSD 3.3-RELEASE #16: Fri Jan 7 18:52:41 CET 2000 root@rox.zlug.org:/usr/src/sys/compile/ROX i386
>Description:
use of c++ keyword 'class' in kernel header file
dev/sub/usb.h, around line 496 in struct usb_device_info
i this need this header file for application programming.
problem affects current kernel source - cvsup'd 2000/01/08 - too
i hope the included patch catches all access of the class field
of struct usb_device_info
>How-To-Repeat:
compile the following sample code with g++ -I/src/sys/dev -c main.c:
-- begin main.c --
#include <usb/usb.h>
-- end main.c --
compile gives:
In file included from main.c:1:
/usr/src/sys/dev/usb/usb.h:476: parse error before `;'
>Fix:
cvs diff: Diffing .
Index: usb.h
===================================================================
RCS file: /home/FreeBSD/CURRENT/src/sys/dev/usb/usb.h,v
retrieving revision 1.17
diff -u -r1.17 usb.h
--- usb.h 1999/12/29 04:35:47 1.17
+++ usb.h 2000/01/01 18:16:27
@@ -489,7 +489,7 @@
u_int16_t productNo; /* idProduct */
u_int16_t vendorNo; /* idVendor */
u_int16_t releaseNo; /* bcdDevice */
- u_int8_t class; /* bDeviceClass */
+ u_int8_t clazz; /* bDeviceClass */
u_int8_t subclass; /* bDeviceSubclass */
u_int8_t protocol; /* bDeviceProtocol */
u_int8_t config; /* config index */
Index: usb_subr.c
===================================================================
RCS file: /home/FreeBSD/CURRENT/src/sys/dev/usb/usb_subr.c,v
retrieving revision 1.21
diff -u -r1.21 usb_subr.c
--- usb_subr.c 1999/12/03 08:41:11 1.21
+++ usb_subr.c 2000/01/08 11:53:17
@@ -1160,7 +1160,7 @@
di->vendorNo = UGETW(dev->ddesc.idVendor);
di->productNo = UGETW(dev->ddesc.idProduct);
di->releaseNo = UGETW(dev->ddesc.bcdDevice);
- di->class = dev->ddesc.bDeviceClass;
+ di->clazz = dev->ddesc.bDeviceClass;
di->subclass = dev->ddesc.bDeviceSubClass;
di->protocol = dev->ddesc.bDeviceProtocol;
di->config = dev->config;
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000108110914.0394814CC1>
