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

Compiler error C247

Hello all,

I have the following situation and error message that I'm not quite able to wrap my head around.

I have a module, let's call it table.c that has something like the following.

code const entry_type table[] = {...};
code const unsigned int tablesize = sizeof(table);

Of course, ... is replaced by a bunch of table data.

In another module, call it access.c, I have the following:

extern code const entry_type table[];
extern code const unsigned int tablesize;

code const unsigned int entrysize = sizeof(entry_type);
code const unsigned int numentries = tablesize/entrysize;

I receive an error C247 when trying to compile the line where I calculate numentries. Oddly enough, it doesn't complain about calculating entrysize, so it's good with making that a code constant. Nor does it have a problem in table.c creating the tablesize code constant. I'm not sure why then it wouldn't think that numentries could be a code constant. I've also tried making sure that table.c is compiled before access.c (just a blind attempt) and that didn't help.

Any help would be greatly appreciated.

Best Regards,

Jay Daniel

0