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

#if & #error giving C322 Error - enum not defined?

Hi

Here is the code I have problems with
I an just starting to use this C compiler
Have used many others, mainly closer to C99

#define Num_LANGUAGEs 6


enum _LANGUAGE {
	eUSING_LAN_START = -1,	// This is always the First item
	eUSING_ENGLISH,
	eUSING_ITALIAN,
	eUSING_FRENCH_Can,
	eUSING_LAST_LANG	// This is always the Last item
};

#if Num_LANGUAGEs != eUSING_LAST_LANG
#error "Warning Not enough Lang defined"
#endif


Where is a list of C Compiler error defs(Not in manual)?

Manual poor on #if conditionals, where can I find more info?

Where is "cosf" function, for faster math?
Where is source for Libraries?

Parents
  • If that is true, then surely that is a fundamental change to the very concept of the preprocessor

    Actually that is not true. I've made a mistake. Here is an extract from the C99 standard:

    The expression that controls conditional inclusion shall be an integer constant expression except that: it shall not contain a cast; identifiers (including those lexically identical to keywords) are interpreted as described below; (footnote 140) and it may contain unary operator
    expressions of the form
    defined identifier
    or
    defined ( identifier )
    ...
    footnote 140: Because the controlling constant expression is evaluated during translation phase 4, all identifiers either are or are not macro names — there simply are no keywords, enumeration constants, etc.


    - mike

Reply
  • If that is true, then surely that is a fundamental change to the very concept of the preprocessor

    Actually that is not true. I've made a mistake. Here is an extract from the C99 standard:

    The expression that controls conditional inclusion shall be an integer constant expression except that: it shall not contain a cast; identifiers (including those lexically identical to keywords) are interpreted as described below; (footnote 140) and it may contain unary operator
    expressions of the form
    defined identifier
    or
    defined ( identifier )
    ...
    footnote 140: Because the controlling constant expression is evaluated during translation phase 4, all identifiers either are or are not macro names — there simply are no keywords, enumeration constants, etc.


    - mike

Children