ARM Technical Support Knowledge Articles


Applies to: C166 C Compiler


Information in this article applies to:


I use a lot of enums in my C code. I need to know if the C compiler performs type checking for enums to validate that I'm using correct enums for certain variables. For example:

enum apple { MAC, GRANNY, WASH_ST };
enum pear { GREEN, BROWN, BARTLETT };

static void func(enum apple a, enum pear p);


The above code generates no warnings when BARTLETT is passed for the enum apple parameter. Is this correct?


Yes. This is correct. Currently, C166 does not perform type checking for enumerations.

PC-Lint performs this type of error checking and it can easily be integrated into the uVision IDE.

Article last edited on: 2004-06-09 15:47:52

Rate this article

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