From owner-freebsd-current Sat Feb 20 15:13:38 1999 Delivered-To: freebsd-current@freebsd.org Received: from keymaster.etla.net (etla.Stanford.EDU [171.64.202.24]) by hub.freebsd.org (Postfix) with ESMTP id 1F64610E6B for ; Sat, 20 Feb 1999 15:13:35 -0800 (PST) (envelope-from hibma@skylink.it) Received: from henny.jrc.it (va-188.skylink.it [194.177.113.188]) by keymaster.etla.net (8.8.8/8.8.7) with ESMTP id PAA03342 for ; Sat, 20 Feb 1999 15:13:33 -0800 (PST) Received: from localhost (localhost.plazza.it [127.0.0.1]) by henny.jrc.it (8.9.3/8.8.7) with SMTP id XAA00352 for ; Sat, 20 Feb 1999 23:05:09 +0100 (CET) (envelope-from hibma@skylink.it) Date: Sat, 20 Feb 1999 23:05:09 +0100 (CET) From: Nick Hibma X-Sender: n_hibma@henny.plazza.it Reply-To: hibma@skylink.it To: FreeBSD current mailing list Subject: const char * Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG With the new efforts in getting rid of all the warnings in the kernel compiles I have a problem with the following warning: ../../dev/usb/ukbd.c: In function `ukbd_detach': ../../dev/usb/ukbd.c:373: warning: cast discards `const' from pointer target type produced by the following two lines in the USB code: (dev/usb/ukbd.c) ukbd_detach(device_t self) { ... const char *devinfo = device_get_desc(self); ... free((void *)devinfo, M_USB); It is a consequence of the following type definition: (sys/bus_private.h) struct device { ... const char* desc; /* driver specific description */ ... } One problem I have is that a string like that might be produced by concatenating a few strings together. In the case of USB the desc is the string returned by the device. At attach the string is created and malloc()-ed, at detach free()-ed. Anyone savvy enough to tell me what I need to change in the USB code to get rid of the warning? Cheers, Nick FreeBSD USB Driver Development -- e-mail: n_hibma@freebsd.org home page: http://www.etla.net/~n_hibma/usb/usb.pl mailing list: usb-bsd@egroups.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message