This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Warning from GCC 4.2.x about qualifiers being discarded


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]