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

WARNING C258 mspace ignored

this "extract to show" compiles with the warning. I definitely do not want the overhead from mspace ignored. What am I missing in making this mspace dependent i.e VFcPtr always code.

here void VFDcdatLgt(unsigned char code VFcPtr[], VFcCcnt);
unsigned char code VFinit[]   = {0x1b, 0x40};
unsigned char xdata GCXvfdBuf[40];

void main (void)
{
VFDcdatLgt(VFinit, 2); // in initialize
}  /*- end main -*/

here void VFDcdatLgt(unsigned char code VFcPtr[], VFcCcnt)
{
unsigned char VFDCtemp;

  for ( VFDCtemp = 0 ; VFcCcnt !=0 ; VFDCtemp++, VFcCcnt--)
  {
    GCXvfdBuf[VFDCtemp] = VFcPtr[VFDCtemp];
  }
}

In advance, thanks

Ertik

Parents
  • void func(array[]) passes a pointer to the array

    At the risk of being called a pedant: that's not exactly true. What this passes is a pointer to the first element of the array, not the array itself. The difference is that you can't modify the array itself through that pointer, but only its contents.

    I suspect the actual difference is in the syntactical scope of the 'code' keyword. In a pointer, there are two things 'code' can modify, depending on where exactly you place the keyword: the memory space of the pointer itself, or of what it points to. For the array-style declaration, this distinction would appear to be impossible (there's no * you can stay to the left or right of).

Reply
  • void func(array[]) passes a pointer to the array

    At the risk of being called a pedant: that's not exactly true. What this passes is a pointer to the first element of the array, not the array itself. The difference is that you can't modify the array itself through that pointer, but only its contents.

    I suspect the actual difference is in the syntactical scope of the 'code' keyword. In a pointer, there are two things 'code' can modify, depending on where exactly you place the keyword: the memory space of the pointer itself, or of what it points to. For the array-style declaration, this distinction would appear to be impossible (there's no * you can stay to the left or right of).

Children