This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C51 doesn't catch mspace mismatch (warning 259)

Hi all,

according to Keil's C51 documentation the compiler should output a warning 259 when pointers to different memory spaces are intermixed.
In a current project I painfully recognized that this does not seem to be the case for C51 versions 7.5 and 8.01.

To check this out I created a new project and again I got no warning. This is what the compiler produced:

     1: void main(void)
     2: {
     3:   char xdata a;
     4:   char idata *p;
     5:   char xdata *q;
     6:
     7:   p = &a;
C:0x0003    7F00     MOV      R7,#0x00
C:0x0005    8F08     MOV      0x08,R7
     8:   q=p;
C:0x0007    AF08     MOV      R7,0x08
C:0x0009    7E00     MOV      R6,#0x00
C:0x000B    8E09     MOV      0x09,R6
C:0x000D    8F0A     MOV      0x0A,R7
     9:   p=q;
C:0x000F    AE09     MOV      R6,0x09
C:0x0011    AF0A     MOV      R7,0x0A
C:0x0013    8F08     MOV      0x08,R7
    10: }

For clarity the optimization level has been switched to 2. Warning level is set to 2.

Each of the three pointer assignments should have created a warning 259 (Pointer: different mspace), but none did!

Has anybody else observed this behaviour or has any advice what I might have done wrong?
If this really is a bug, I think it's really critical and should be fixed as fast as possible.

Thanks in advance
Jens