Clarification of Enumerated Type's Size

Product Version(s): 3.3x
Operating System:   MS-DOS
Flags: ENDUSER | TAR21431
Last Modified:  4-OCT-1988    ArticleIdent: Q11067

Problem:

There is an example in the "Microsoft Pascal Compiler Reference
Manual" for the RETYPE procedure. If the example is followed exactly,
the following warning message is given upon compiling:

Warning 248 size not identical.

Response:

Because the enumerated type in question has only three values (COLOR =
(RED, GREEN, BLUE)), values of this type are stored in one byte. This
explains why the warning error occurs when the integer constant is
RETYPEd as a COLOR. If the enumerated type COLOR had been defined to
have more than 255 values, then values of type COLOR would be stored
in a word (two bytes) and the warning error would not occur.
