Technical Support

C166: VARIABLE ORDERING

QUESTION

I need help with the "Keep Variables in Order" option for the C166 Compiler. I have the following declaration:

const unsigned char serialNumDelimeter[6] = {0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55};
const volatile long serialNum = SERIAL_NUMBER;

I expected serialNum to immediately follow serialNumDelimeter in the address space, but this is not the case. In fact, they are reversed. Why is that?

ANSWER

Variable ordering only works with variables, not constants. A solution is to incorporate the constants into a data structure in the proper order.

Last Reviewed: Monday, June 07, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure