Keil Logo

C51: WARNING C259 (DIFFERENT ENUMERATION TYPES)


Information in this article applies to:

  • C51 Version 7.02

QUESTION

When I try to build the following code, I receive Warning C259, complaining about enumeration types. For example:

typedef enum   { ZERO, ONE, TWO }   Numbers;

void main(void)
{
      unsigned char GetNumber( void );

      unsigned char     uc_i = 2;
      Numbers     e_numbers;

      e_numbers = uc_i;                   // This causes an expected warning
      e_numbers = GetNumber();            // This causes an expected warning
      e_numbers = (Numbers)GetNumber();   // This still causes a warning
}

unsigned char GetNumber( void )
{
      return 1;
}

This generates the following warnings:

MAIN.C(11): warning C259: '=': different enumeration types
MAIN.C(12): warning C259: '=': different enumeration types
MAIN.C(13): warning C259: '=': different enumeration types

Is it a problem or am I missing something?

ANSWER

Yes. This is a problem with the tools. You may request a patch that solves it in the attachments section below. Or, you may download the latest updates from the Keil Website.

RESOLUTION

This problem is resolved in C51 V7.03a.

SEE ALSO

Last Reviewed: Friday, May 20, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.