warning: type qualifier is meaningless on cast type

I am receiving a "warning: type qualifier is meaningless on cast type" using the following:

I have some declarations in an include file such as:

short* const memloc=(short*)0x90040000;

In the main I am calling a function such as:

memwdat(memloc,0xFF);

The function is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void memwdat(short* const Address, unsigned int data)
{
	char x;
	
	if (Address>=(short* const)0x90000000 && Address<(short* const)0x90040000)
		{
		*MC0_PDCLR=0xFFFFFFBF;
		*MC0_PDSET=0x00000000;
		}
	else 
		{
		*MC0_PDCLR=0xFFFFFFBF;
		*MC0_PDSET=0x00000810;
		}

	*Address=data;

}


I end up with a warning for both comparisons in the if statement. I will state that the program does work correctly in spite of the warnings, but I would like to know what I am doing wrong and correct it if possible.

Does anyone have any clues on why this is occurring and/or how to fix?

Thanks in advance for any help you can give.
if you do this - does the warning go away?

if (Address>=(short* )0x90000000 && Address<(short* )0x90040000)
Last edited on
Yes it does. Hmm, I could have sworn I tried that with no results. Thank you.
Topic archived. No new replies allowed.