The followign code is invalid:
void set_a(void)
{
}
void set_b(void)
{
}
__addressmod set_a space_a;
__addressmod set_b const space_b;
space_a int *a;
space_b int *b;
void f(void)
{
a = b; // Error here
}
We do get the error message on the correct line, but as dbuf_printTypeChain doesn't include the named address spaces, the text of the error message is confusing:
test.c:19: error 129: pointer types incompatible
from type 'int generic* fixed'
to type 'int generic* fixed'
Maybe we could unify handling of printing of named address spaces, handling intrinsic and non-intrinsic spaces in a similar way.
can some sort of rtti be generated for those types? because the list of pointers all to one named space is not that useful, then it may be when it is a list of pointers to different spaces.
or maybe a just far pointer type?
I made a library for far pointers, but isn't it better to have a native support for this: https://github.com/untoxa/sdcc4_farptr_example
Yes, it would make sense to have native support for far pointers for the gbz80.
However, this bug report is about named addres spaces. We still need them to allow the user to handle banking schemes not known to SDCC (as is typical on Z80-based systems - e.g. in the Sega Master System the bank-switching hardware is actually in the cartridge, so there are many different ones in use for just one Z80-based system).
of course, i meant not "instead", but "in addition". thank you for the reply.
Fixed in [r13826].
Related
Commit: [r13826]