Date: Sat, 20 Oct 2001 13:18:32 -0700 (PDT) From: John Mechalas <seagull@aracnet.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/31391: usb.h uses a variable name "class" which conflicts with C++ Message-ID: <200110202018.f9KKIWO11342@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 31391 >Category: kern >Synopsis: usb.h uses a variable name "class" which conflicts with C++ >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 20 13:20:00 PDT 2001 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110202018.f9KKIWO11342>