Keil Logo



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?


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 7, 2004

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.