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
  • How about:

    void VFDcdatLgt(unsigned char code* VFcPtr, VFcCcnt);

    instead? You can't specify an mspace for a parameter, but you can for the target of a pointer.

    I'd also suggest

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

    Or, more likely, a #define for the size of the array. It's rare (at least for me) to have a use for an array of unknown size since so many routines wind up needing to know the size. Might as well have a constant for it. And supplying a explicit size lets the compiler / lint check the initializer for completeness, which helps when changing the size of the array.

Reply
  • How about:

    void VFDcdatLgt(unsigned char code* VFcPtr, VFcCcnt);

    instead? You can't specify an mspace for a parameter, but you can for the target of a pointer.

    I'd also suggest

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

    Or, more likely, a #define for the size of the array. It's rare (at least for me) to have a use for an array of unknown size since so many routines wind up needing to know the size. Might as well have a constant for it. And supplying a explicit size lets the compiler / lint check the initializer for completeness, which helps when changing the size of the array.

Children
More questions in this forum