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 in Keil C51 V7.02b

After upgrading to 7.02b, I get a C258 Warning when using the typedef in the following example.

If I use 'bit' directly, the Warning is not issued.

Any clues?

Best regards and thanks in advance.

Jose


volatile unsigned char c1, c2, c3;

typedef bit BOOL;

unsigned char func1(BOOL a, unsigned char b)
{
  if (a) return b;
  else return ~b;
}

void main(void)
{
  c1 = func1(0, 9);
  c2 = func1(1, 8);
}

Parents
  • Some more information on the issue:

    If the parameters are swapped, the Warning is not issued. In the following example,
    func1 generates the following warning:

    MAIN.C(5): warning C258: 'b': mspace on parameter ignored
    

    but func2 compiles ok.

    Jose

    unsigned char func1(BOOL a, unsigned char b)
    {
      if (a) return b;
      else return ~b;
    }
    
    unsigned char func2(unsigned char b, BOOL a)
    {
      if (a) return b;
      else return ~b;
    }
    

Reply
  • Some more information on the issue:

    If the parameters are swapped, the Warning is not issued. In the following example,
    func1 generates the following warning:

    MAIN.C(5): warning C258: 'b': mspace on parameter ignored
    

    but func2 compiles ok.

    Jose

    unsigned char func1(BOOL a, unsigned char b)
    {
      if (a) return b;
      else return ~b;
    }
    
    unsigned char func2(unsigned char b, BOOL a)
    {
      if (a) return b;
      else return ~b;
    }
    

Children
No data