In article <pine.bsf.3.96.990220224447.327a-100...@henny.plazza.it>,
Nick Hibma  <hi...@skylink.it> wrote:
> 
> 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);
...
> Anyone savvy enough to tell me what I need to change in the USB code to
> get rid of the warning? 

The warning comes because "-Wcast-qual" is on the command line.  I
don't think there's any way to get rid of the warning without changing
the declarations.

In my opinion, the use of "-Wcast-qual" is bogus.  Often the whole
point of a cast is to remove a qualifier such as const.  It's one
thing to warn when that's done implicitly, and quite another thing to
warn when the programmer has clearly expressed his intent through the
use of a cast.

John
-- 
  John Polstra                                               j...@polstra.com
  John D. Polstra & Co., Inc.                        Seattle, Washington USA
  "Nobody ever went broke underestimating the taste of the American public."
                                                            -- H. L. Mencken


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to