ARM Technical Support Knowledge Articles

WARNING C259 (DIFFERENT ENUMERATION TYPES)

Applies to: C51 C Compiler

Answer


Information in this article applies to:


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

ATTACHED FILES

Request the files attached to this knowledgebase article.

Article last edited on: 2005-05-20 08:59:08

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential