Use of C's enum command with C166 compiler

I'm currently attempting to modify an automatic code generation
package (designed to run with MSVC/C++, WATCOM C/C++ and
Borland C) to autogenerate software compilable with the Keil
CA166 package. Of the standard files which have to be included
into the code, one of them contains the lines...

enum {
COMPLEX_INHERITED = -1,
COMPLEX_NO,
COMPLEX_YES
};

...but the C166 compiler 'seems' to be objecting to the fact that
I'm using a negative number within the enum command.

According to K & R the enum command should be declaring the
contents of the enum commands to be of type 'int' - so I can't
see what the problem is.

Can anyone shed any light on this? Where am I going wrong?


Yours (grateful in advance),


Richard Roebuck.

Parents
  • I also have bumped into this behavior but found like Mark stated that it was how I was using the enum that was the cause. For instance if it is used in array subscripting, the negative value would be an error. However the compiler does not always give an error that relates to the actual problem.

Reply
  • I also have bumped into this behavior but found like Mark stated that it was how I was using the enum that was the cause. For instance if it is used in array subscripting, the negative value would be an error. However the compiler does not always give an error that relates to the actual problem.

Children
More questions in this forum