public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* volatile void * pointer conversion
@ 2005-10-06  7:55 Josef Angermeier
  2005-10-06 11:50 ` John Love-Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: Josef Angermeier @ 2005-10-06  7:55 UTC (permalink / raw)
  To: gcc-help


Hello

Is there any way to cast a volatile void pointer to e.g. a char pointer,
without getting a warning from gcc ?

Here is the warning:

pci.c:665: warning: cast discards qualifiers from pointer target type


example code:

extern int
pci_copyrom(volatile void * p)
{
	unsigned char * romp;

	romp = (unsigned char *) p;


thanks in advance 

josef

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: volatile void * pointer conversion
  2005-10-06  7:55 volatile void * pointer conversion Josef Angermeier
@ 2005-10-06 11:50 ` John Love-Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: John Love-Jensen @ 2005-10-06 11:50 UTC (permalink / raw)
  To: Josef Angermeier, MSX to GCC

Hi Josef,

Try either adding the volatile qualifier to romp, or removing the volatile
qualifier from p.

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-06 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-06  7:55 volatile void * pointer conversion Josef Angermeier
2005-10-06 11:50 ` John Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).