/perform.c --- usr.bin.all__D
--- /usr/src/usr.bin/dig/../../contrib/bind9/bin/dig/dighost.c:4340:27:
error: passing 'const char *' to parameter of type 'void *' discards
qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
isc_buffer_init(buffer, str, len);
[...]
signature.asc
: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
../../dev/usb/ukbd.c: In function `ukbd_detach':
../../dev/usb/ukbd.c:373: warning: cast discards `const' from pointer
target type
...
It is a consequence of the following type definition:
(sys/bus_private.h)
struct device {
...
const char* desc; /* driver specific description
char
* to char * explicitly would be OK. But casting from, say, const
char * to void * would still produce a warning. This would make it
possible to get rid of the warnings in those cases where it made sense
to cast away const (e.g., dealing with bad but standard interfaces).
The above is more
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
/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