From: Michael Hope <michaelh@ju...> - 2001-11-05 16:23:29
-----BEGIN PGP SIGNED MESSAGE-----
On Mon, 5 Nov 2001, Johan Kotlinski wrote:
> Well... For example:
> UBYTE *foo=0x8000;
> .,.gives an warning because I don't do a cast. I think it's a bit picky.
This one seems correct to me. gcc gives a warning as well.
> And also, I just don't know how to cast UWORD to a function pointer...
> :\ Guess I should buy a C reference manual...
Have a look at examples/gb/ram_fn.c. It's got a couple of casts there.
typedef void (*FUNPTR)(void);
FUNPTR fptr = (FUNPTR)0xA000;
Note that this:
FUNPUTR fptr = (void (*)(void))0xA000;
won't work due to sdcc being overly pedantic. This is on my long term to
fix list, as for now there is a work around.
- -- Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (OpenBSD)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----