From owner-freebsd-bugs Sat Oct 20 13:20: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E511337B408 for ; Sat, 20 Oct 2001 13:20:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9KKK3i11448; Sat, 20 Oct 2001 13:20:03 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BFECB37B405 for ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/31391: usb.h uses a variable name "class" which conflicts with C++ Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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 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