Menu

#2998 Confusing error message for non-intrinsic named address space

closed-fixed
None
Front-end
5
2023-01-26
2020-04-25
No

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'

Related

Wiki: NGI0-Entrust-SDCC

Discussion

  • Philipp Klaus Krause

    • summary: Confusing error message for named address space --> Confusing error message for non-intrinsic named address space
     
  • Philipp Klaus Krause

    Maybe we could unify handling of printing of named address spaces, handling intrinsic and non-intrinsic spaces in a similar way.

     
  • Tony Pavlov

    Tony Pavlov - 2020-04-25

    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.

     
  • Tony Pavlov

    Tony Pavlov - 2020-04-25

    or maybe a just far pointer type?

     
  • Tony Pavlov

    Tony Pavlov - 2020-05-25

    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

     
    • Philipp Klaus Krause

      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).

       
      • Tony Pavlov

        Tony Pavlov - 2020-05-27

        of course, i meant not "instead", but "in addition". thank you for the reply.

         
  • Philipp Klaus Krause

    Fixed in [r13826].

     

    Related

    Commit: [r13826]

  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
    • Category: other --> Front-end
     

Log in to post a comment.