[Gllug] Re: invalid type argument of `unary *'

Ian Bowden ian.bowden at albany.uk.com
Sun Feb 19 18:09:09 UTC 2006


On Sun, 2006-02-19 at 18:02 +0000, Ian B wrote:
> On Sat, 2006-02-18 at 23:24 +0000, Adrian McMenamin wrote:
> > I know this question makes me look a hopeless C programmer, but there
> > you go.
> > 
> > Why won't this compile? (I want to know what is in the address
> > 0xa0811000)
> > 
> >         long uBuf = 0xa0811000;
> >         snd_printk("Buffer starts with %X\n", *uBuf);
> 
I'm sorry, my previous posting had a glaring error which crept in as I
over-optimised my c-code.  What I should have said was:
	long *uBuf;
	uBuf = (long *) 0xa0811000;
	printf("Buffer at %X starts with %X\n",uBuf,*uBuf);

The reason is still the same.  The compiler needs the cast to know that
0xa0811000 is a pointer value.

	Ian B.


-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list