Warning from GCC 4.2.x about qualifiers being discarded

Kevin P. Fleming kpfleming@starnetworks.us
Thu Dec 13 13:29:00 GMT 2007


In recent versions of GCC (tested just now with GCC 4.2.2), compiling
Zaptel 1.4 kernel modules generates a number of warnings like this:

warning: passing argument 3 of 'pci_free_consistent' discards qualifiers
from pointer target type

This happens when a 'volatile unsigned char *' is passed to the 'void *'
argument of pci_free_consistent(). Even adding explicit casts to
'unsigned char *' or 'void *' does not eliminate this warning.

In GCC 4.2.3 prerelease (as packaged by Debian unstable), this occurs
with calls to memset() on these pointers as well.

I'm not really sure there's much we can do about this; the pointer
*does* point to volatile memory, and it's not really reasonable to have
to provide our own version of memset() just to avoid this warning, is it?



More information about the Gcc-help mailing list